首页 > Web开发 > 详细

thinkPHP重写模板方案

时间:2015-04-05 18:56:41      阅读:183      评论:0      收藏:0      [点我收藏+]

    thinkPHP重写模板方案:


    方案一:(以传变量形式替换)
   

    <include file="header" title="ThinkPHP框架" keywords="开源WEB开发框架"/>

    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <title>[title]</title>
        <meta name="keywords" content="[keywords]" />
    </head>


    方案二:(以模板方式重写,版本在3.1.2以上支持)
       

    base.tpl
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <block name="title"><title>标题</title></block>
    </head>
    <body>
        <block name="menu">菜单</block>
    </body>
    </html>

    <extend name="base"/>
    <block name="title"><title>???</title></block>
    <block name="menu">
         ???信息
    </block>

本文出自 “Shows technology” 博客,请务必保留此出处http://wangzhijun.blog.51cto.com/9660708/1629116

thinkPHP重写模板方案

原文:http://wangzhijun.blog.51cto.com/9660708/1629116

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