]> WPIA git - gigi.git/blobdiff - doc/TemplateSyntax.txt
ADD: If-else documentation
[gigi.git] / doc / TemplateSyntax.txt
index 9309f5e21808521681eeed194a838296af6449ac..75a42b2b247f5360dc6d8b1d931503af163d9fa2 100644 (file)
@@ -11,11 +11,14 @@ A template is constructed from a charstream. Everything that is not in "<?" to "
 
 - <?=$!variablename?> will output the variable "variablename" but not HTML-escaped
 - <?=s,$!variablename,My %s text?> will insert the variable "variablename" into the translated text but not HTML-escaped
+- <?=s,"some data",My %s text?> will insert "some data" into the translated text
+- <?=s,!"some data",My %s text?> will insert "some data" into the translated text literally (not HTML-escaped)
   
-- <? if($variable) { ?>
-  Output/execute the text until "<? } ?>" only if $variable not null or Boolean.FALSE.
-  
-- <? foreach($variable) { ?>
+- <? if($variable) { ?> ... <? } ?>
+  Output/execute the text until "<? } ?>" only if $variable is Boolean.TRUE (<=> !Boolean.FALSE) or not null. 
+- <? if(...) { ?> ... <? } else { ?> ... <? } ?>
+
+- <? foreach($variable) { ?> ... <? } ?>
   If $variable is an "IterableDataset"
   Output/execute the text until "<? } ?>" repeated as $variable suggests. 
   Special variables that $variable defines can be used in the inner text.