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'); ?>