1、在app\index\controller文件夹新建一个名为Lyot(自定义)的控制器,在控制器中定义:

  

tp5.1 前台模板使用公共模板网页(header.html、foot.html、base.html)_自定义

tp5.1 前台模板使用公共模板网页(header.html、foot.html、base.html)_html_02

 

  2、创建一个被继承的public(自定义)文件夹,里面有三个文件,分别是header.html、foot.html、base.html

  (1)header.html

tp5.1 前台模板使用公共模板网页(header.html、foot.html、base.html)_javascript_03

 

  (2)foot.html

tp5.1 前台模板使用公共模板网页(header.html、foot.html、base.html)_javascript_04

 

  (3)base.html

tp5.1 前台模板使用公共模板网页(header.html、foot.html、base.html)_html_05

 

 

  3、创建于控制器对应的视图文件view/lyot/test2.html,内容:

tp5.1 前台模板使用公共模板网页(header.html、foot.html、base.html)_javascript_06

 

  4、访问地址:localhost/安装框架路径/public/index.php/index/lyot/test2,

    (1)效果1:正常访问情况

tp5.1 前台模板使用公共模板网页(header.html、foot.html、base.html)_html_07

 

  

    (2)效果2:显示编辑内容的同时,也显示默认的内容:

        1)test2.html部分:    

tp5.1 前台模板使用公共模板网页(header.html、foot.html、base.html)_自定义_08

      

        2)效果:

  

tp5.1 前台模板使用公共模板网页(header.html、foot.html、base.html)_html_09

 

 

    以上

    END