]> WPIA git - gigi.git/blob - doc/TemplateSyntax.txt
Deleted should be NULL if not set, and not strange date.
[gigi.git] / doc / TemplateSyntax.txt
1 A template is constructed from a charstream. Everything that is not in "<?" to "?>" will be outputted directly. Text in these markers will be interpreted is template scripting syntax. The following strings are valid:
2
3 - <?=$variblename?> will output "variablename".
4    if "variablename" is an Outputable output this thing recursively.
5    else turn it into a String (Object.toString()) and output it.
6    
7 - <?=_This is free Text.?> will translate "This is free Text." into the users language, (escaped) and output it.
8    
9 - <?=s,$var1,$var2,$var3,...,$varn,This %s is, %s free.?>
10   Translate the last string. Output $var1,...,$varn replaced into the %s positions in the translated string.
11
12 - <?=$!variablename?> will output the variable "variablename" but not HTML-escaped
13 - <?=s,$!variablename,My %s text?> will insert the variable "variablename" into the translated text but not HTML-escaped
14 - <?=s,"some data",My %s text?> will insert "some data" into the translated text
15 - <?=s,!"some data",My %s text?> will insert "some data" into the translated text literally (not HTML-escaped)
16   
17 - <? if($variable) { ?>
18   Output/execute the text until "<? } ?>" only if $variable not null or Boolean.FALSE.
19   
20 - <? foreach($variable) { ?>
21   If $variable is an "IterableDataset"
22   Output/execute the text until "<? } ?>" repeated as $variable suggests. 
23   Special variables that $variable defines can be used in the inner text.
24  
25   
26