本文实例讲述了thinkphp5.1框架模板布局与模板继承。分享给大家供大家参考,具体如下:
模板全局配置
配置文件template.php添加
//开启全局模板布局 'layout_on' => true, //全局模板布局文件名 'layout_name' => 'layout'
模板布局
控制器中新建模板文件(applicationindexcontrollerDemo—test方法)
新建视图文件(applicationindexdemotest.html)
模板入口文件(applicationindexviewindexindex.html)
将公共模板头部和尾部分别单独放到一个html文件中(header.html、footer.html)【applicationindexview】
创建全局模板布局文件(layout.html)【applicationindexview】首先开启布局 layout_on = true
—-想了解thinkphp5.1框架模板布局与模板继承用法分析分享!且更多的php教程关注<计算机技术网(www.ctvol.com)!!>
{include file="header"本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/phpttorial/469715.html