{variable}

{variable} -- creates PHP code to echo a variable

概要

Usage ({variable}, {variable:h}, {variable:u})

説明

creates PHP code to echo a variable, with optional modifier. Modifiers are

by default variables are assumed to have calling scope, and are prefixed with $t->, however if they are inside a loop (foreach), then the variables created by the loop are added to the scope and the prefix is not added.

例 40-1setting an object variable

$this->a = "hello >>";
$template->outputObject($this);

例 40-2Outputting the variable

{a}
{a:h}
{a:u}

例 40-3Compiled template

<?php echo htmlspecialchars($t->a); ?>
<?php echo  $t->a; ?>
<?php echo urlencode($t->a); ?>

例 40-4Simple ouput example

hello &gt;&gt;
hello >>
hello+%3E%3