string conditionals(
string
$input)
|
|
Conditional inclusion
This allows you to do conditional inclusion (eg. blocks!)
Maps conditions
{if:t.xxxx} => <?php if ($t->xxxx) { ?> {if:t.x_xxx()} => <?php if ($t->x_xxx()) { ?>
Parameters:
string include_template(
string
$input)
|
|
sub template inclusion
This allows you to do include other files (either flat or generated templates.).
{include:t.abcdef} maps to <?php if($t->abcdef && file_exists($compileDir . "/". $t->abcdef . "en.php")) include($compileDir . "/". $t->abcdef . ".en.php"); ?>
include abcdef.en.php (Eg. hard coded compiled template {include:#abcdef#} => <?php if(file_exists($compileDir . "/abcdef.en.php")) include($compileDir . "/abcdef.en.php"); ?>
include raw {t_include:#abcdef.html#} => <?php if(file_exists($templateDir . "/abcdef.html")) include($compileDir . "/abcdef.html"); ?> Compile and include {q_include:#abcdef.html#} => <?php HTML_Template_Flexy::staticQuickTemplate('abcedef.html',$t); ?>
Parameters:
string looping(
string
$input)
|
|
Looping
This allows you to do loops on variables (eg. nested/ repeated blocks!)
Maps Methods {foreach:t.xyz,zzz} maps to <?php if ($i->xyz) foreach ($t->xyz as $zzz) { ?> {foreach:t.xyz,xxx,zzz} maps to <?php if ($i->xyz) foreach ($t->xyz as $xxx=>$zzz) { ?> {end:} maps to <?php }?> {else:} maps to <?php }else{?>
Parameters:
string methods(
string
$input)
|
|
Calling Methods
This allows you to call methods of your application
Maps Methods {t.xxxx_xxxx()} maps to <?php echo htmlspecialchars($t->xxxx_xxxx())?> {t.xxxx_xxxx():h} maps to <?php echo $t->xxxx_xxxx()?>
{t.xxxx_xxxx(sssss.dddd)} maps to <?php echo htmlspecialchars($t->xxxx_xxxx($ssss->dddd))?> {t.xxxx_xxxx(sssss.dddd):h} maps to <?php echo $t->xxxx_xxxx($ssss->dddd)?> {t.xxxx_xxxx(sssss.dddd):s} maps to <?php highlight_string($t->xxxx_xxxx($ssss->dddd))?>
{t.xxxx_xxxx(#XXXXX#)} maps to <?php echo htmlspecialchars($t->xxxx_xxxx('XXXXXX'))?> {t.xxxx_xxxx(#XXXXX#):h} maps to <?php echo $t->xxxx_xxxx('XXXXXX')?>
{t.xxxx_xxxx(sss.ddd,sss.ddd)} maps to <?php echo htmlspecialchars($t->xxxx_xxxx($sss->ddd,$sss->ddd))?> {t.xxxx_xxxx(#aaaa#,sss.ddd)} maps to <?php echo htmlspecialchars($t->xxxx_xxxx("aaaa",$sss->ddd))?> {t.xxxx_xxxx(sss.ddd,#aaaa#)} maps to <?php echo htmlspecialchars($t->xxxx_xxxx($sss->ddd,"aaaa"))?>
Parameters:
string urlencoded_variables(
string
$input)
|
|
Urlencoded Variable replacement
Often when you use a WYSISYG editor, it replaces { in the href="{somevar}" with the urlencoded version, this bit fixes it.
Maps variables %??i.xyz%?? maps to <?php echo htmlspecialchars($i->xyz)?> %??i.xyz:h%?? maps to <?php echo $i->xyz?> %??i.xyz:u%?? maps to <?php echo urlencode($i->xyz)?> %??i.xyz:ru%?? maps to <?php echo urlencode($i->xyz)?> THIS IS PROBABLY THE ONE TO USE!
%??i.xyz:uu%?? maps to <?php echo urlencode(urlencode($i->xyz))?>
Parameters:
string variables(
string
$input)
|
|
Standard Variable replacement
Maps variables {i.xyz} maps to <?php echo htmlspecialchars($i->xyz)?> {i.xyz:h} maps to <?php echo $i->xyz?> {i.xyz:u} maps to <?php echo urlencode($i->xyz)?> {i.xyz:ru} maps to <?php echo rawurlencode($i->xyz)?>
{i.xyz:r} maps to
xyz)?>
{i.xyz:n} maps to <?php echo nl2br(htmlspecialchars($i->xyz))?>
Parameters: