Skip to content
it4e edited this page Oct 4, 2016 · 2 revisions

Name

<chl/chl.h>

[inline] import, import

Declaration

import(path);

Description

The inline CHL function import is used to fetch the contens of a file [path]. Should be called in an inline way, preferably inside of a view file.

Arguments

  • path: the path to the file

Return value

No return value.


Examples

main.c

#include <chl/chl.h>
#include <stdio.h>

int main() {
    // Import view file
    chl_view("index.vw");
}

index.vw (view file)

....
<body>
<{ import("hello.vc"); }>
</body>
....

hello.vc (view component file)

Hello world!

Output: .... <body> Hello world! </body> ....

As CHL is open-source, people are able to contribute with their own APIs, plugins and code which means that CHL is constantly upgraded and provided with new features. Do you have an idea for a new CHL feature and want to contribute?

See contribute.

Setup. API. Tutorial. Examples. FastCGI.

Clone this wiki locally