亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

eval function

eval function

If the special attribute "assign" is specified, the output value of the function will be assigned to the template variable specified by assign instead of being output directly. .

Technical Note: Variables to be evaluated are treated as templates. They follow the same structure and safety features as templates.

Technical points: The variables to be evaluated are recompiled each time they are called, and the compiled version is not saved! But when the buffering setting is turned on, the output will be buffered by other templates.

test.php:

##$smarty->assign('data',array(1,2,3));


##test.html:

{section name=rows loop=$data}

<tr class="{cycle values="odd,even"}"> <td>{$data[rows]}</td> ;
</tr>
{/section}

##Output:
<tr class="odd" > <td>1</td></tr>
<tr class="even">
<td>2</td>
</tr>
<tr class="odd">
<td>3</td>
</tr>


Continuing Learning
||
<?php echo "eval函數(shù)";
submitReset Code