サマリー:{// 公用模板} {block name="header"} {include file="public/header" /} {/block} {block name="content"} &nb
{// 公用模板} {block name="header"} {include file="public/header" /} {/block} {block name="content"} 內(nèi)容主體部分 {/block} {block name="footer"} {include file="public/footer" /} {/block} {// 先繼承父模板} {extend name="public"} {//重寫主體內(nèi)容部分} {block name="content"} <style type="text/css"> .content{ width: 900px; height: 500px; background: #006666; color: black; text-align: center; margin: auto; margin-bottom: 16px; } </style> <div class="content"> <p>這里是內(nèi)容部分</p> <p>我正則學習ThinkPhp的模板繼承</p> </div> {/block}
添削の先生:天蓬老師添削時間:2019-04-23 13:33:57
先生のまとめ:模板繼承做為一種代碼復(fù)用技術(shù), 極大的方便了程序員開發(fā)項目, 類似于傳統(tǒng)開發(fā)中的函數(shù)