码迷,mamicode.com
首页 > 其他好文 > 详细

$this->display输出模板

时间:2015-11-08 14:51:09      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

 

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

 

$this->display输出模板

标签:

原文地址:http://www.cnblogs.com/wesky/p/4947117.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!