首页 > 移动平台 > 详细

“字符串替换” 和 “模板设置” (application/config.php)

时间:2017-08-18 17:02:51      阅读:309      评论:0      收藏:0      [点我收藏+]
//视图输出字符串内容替换
‘view_replace_str‘ => [
‘__PUBLIC__‘ => ‘/public/‘,
‘__ROOT__‘ => ‘/‘,
],

模板设置:
template下添加:
‘layout_on‘ => true,
‘layout_name‘ => ‘layout‘,
‘layout_item‘ => ‘[__REPLACE__]‘

同时layout.html改为[__REPLACE__]
{include file="templet/header" /}
[__REPLACE__]
{include file="templet/footer" /}

或者layout.html
{include file="templet/header" /}
{__CONTENT__}
{include file="templet/footer" /}
另外在使用index.html中加
{layout name="layout" /}
文件中开头定义 layout 标签 ,表示当前模板使用了布局,布局模板文件为 layout.html ,
布局模板中的 {__CONTENT__} 会自动替换为解析后的index.html内容。

“字符串替换” 和 “模板设置” (application/config.php)

原文:http://www.cnblogs.com/xuekun/p/7390410.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!