thinkPHP重寫模板方案

    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>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章