TinyPHPHelperClasses 一个小的单文件php模板引擎
微型模板引擎一个小的单文件php模板引擎支持占位符变量的{Title} {IF:Condition} 、 {ELSE}和{ENDIF}用于IF语句{LOOP:Loopvariable}和{ENDLOOP} for循环。PHP代码:
// 引入文件
require_once('template.class.php');
// 创建一个新模板
$tpl = new Template('page.tpl');
// 为模板构建数据结构
$peoples = array();
$peoples[0] = array('name' => 'miller', 'surname' => 'peter');
$peoples[1] = array(...);
下载地址
用户评论