smarty中的几个常用函数 templateExists() fetch() include
templateExists()
$smarty->templateExists();
<?php
// 设置文件名,如 index.inc.tpl
$mid_template = $_GET['page'].'.inc.tpl';
if( !$smarty->templateExists($mid_template) ){
$mid_template = 'page_not_found.tpl';
}
$smarty->assign('content_template', $mid_template);
$smarty->display('page_container.tpl');
?>
还没有评论,来说两句吧...