Skip to content

WebFramework templates

Semyon Gritsenko edited this page May 12, 2024 · 5 revisions

Template interpreter only works with code in {% %} wrapper in files with .wfdp extension.
Each function call must be ended with semicolon.
Each variable must be surrounded with $ symbol.

Example:
...

{%<h1>print($name$, $surname$);</h1>%}

...

After interpreter run example would looks like
...

<h1>UserName UserSurname</h1>  

...

List of functions:

Syntax

print(...);

Parameters

... - arguments surrounded by $ symbol.

Return value

All argument values splitted by comma.

Syntax

include($pathToFile$);

Parameters

$pathtoFile$ - path to file that replace function.

Return value

File content.

Syntax

for(start, end, functionName, [optional]cycleStep);

Parameters

start - start index.
end - index after end.
functionName - name of standard function or newly registered function.
cycleStep - custom cycle step value [optional parameter](default value is 1)

Return value

Function execution result repeated (end - start) times(default)

Clone this wiki locally