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

  

 

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

  (1)header.html

 

  (2)foot.html

 

  (3)base.html

 

 

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

 

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

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

 

  

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

        1)test2.html部分:    

      

        2)效果:

  

 

 

    以上

    END

 

转载:https://wwwblogs/finalanddistance/p/9043388.html

更多推荐

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