1.public function index(){
$this->display()
}
// 默认输出的是index.html模板
2.public function index(){
$this->display(‘select‘)
}
输出的是select.html模板;如果是select.htm 用$this->display(‘select‘)是无法输出的,需要经进行配置
3.配置 TMPL_TEMPLATE_SUFFIX(模板文件后缀名)
根目录/Index/Conf/config.php (只对Index下的目录有效)
代码:
<?php return array( //模板文件后缀名 ‘TMPL_TEMPLATE_SUFFIX‘ =>‘.htm‘ ) ?>
根目录/Conf/config.php (对所有目录有效Index、Admin)
<?php $config = array( ‘LOAD_EXT_FILE‘=>‘fun‘, ‘TMPL_PARSE_STRING‘ => array( ‘__PUBLIC__‘ => __ROOT__.‘/‘.APP_NAME.‘/Tpl/Public‘, ), ‘TMPL_TEMPLATE_SUFFIX‘ =>‘.htm‘ ); return array_merge(include(‘./Conf/config.php‘),$config); ?>
时间: 2024-10-10 07:44:24