简单快速的php模板引擎-PHP源码
简单快速的php模板引擎1.调用
setAttr("title", "Variable example"); //第二种设置输出参数的方法 $view->array = array( '1' => "First array item", '2' => "Second array item", 'n' => "N-th array item", ); $view->j = 5; //输入页头、内容、页脚 $view->display("header.php")->display('index.php')->display('footer.php')->render();
2.theme/views/index.php
{comment} 这是注释 {/comment} {if $array} {foreach $array as $key => $value} {$key} => {$value}
{/foreach} {else} {/*}这也是注释{*/}Array is empty!
{/if} {$i = 1} {while $i < $j} 当前 no. {$i}
{$i++} {/while}
PHP之友评论