私人领地

$this->display输出模板

 

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

 

posted @ 2015-11-08 12:17  狂奔的蜗牛Snails  阅读(1535)  评论(0编辑  收藏  举报