Blogger Information
Blog 8
fans 0
comment 1
visits 6051
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
4.模板继承与区块设计
嫩嫩小宝的博客
Original
583 people have browsed it

为了使代码更简洁,对于重复部分的代码可以分离出去,建立一个父模板,其余格式相同的的子模板只需继承父模板并在父模板的基础上改动即可。



  1. 基础模板(父模板)只用到{block}{include}标签,其他标签几乎不会用到

    {block name="区块名称"}

       //代码

       {/block}

   2.子模板的继承:子模板中只允许出现{extend}{block}这两个标签

      {extend name="父模板路径" /}

      ps:若子模板需要引入父模板{block}中间的内容,需使用{__block__}

   


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post