abstract:<?php /** * default.php php入口頁面 */ include __DIR__."/config/config.php"; $smarty->display('default.html');{* default.html 模板繼承文件并對模板文件區(qū)塊進行重
<?php /** * default.php php入口頁面 */ include __DIR__."/config/config.php"; $smarty->display('default.html');
{* default.html 模板繼承文件并對模板文件區(qū)塊進行重寫*} {*繼承模板布局內容*} {extends file="mod.html"} {*對模板標題內容區(qū)塊重寫*} {block name="title"} 模板標題-親愛的xxx會員 {/block} {*對廣告位1內容區(qū)塊重寫*} {block name="advert1"} <div>模板導航區(qū)廣告位-----變更為---》澳門首家皇冠視頻上線啦!</div> {/block} {*對廣告位2內容區(qū)塊重寫*} {block name="advert2"} <div>模板導航區(qū)廣告位-----變更為---》香港首家皇冠視頻上線啦!</div> {/block}
{*mod.html 模板布局頁面*} <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>{block name="title"}模板標題{/block}</title> </head> <body> {*模板頭部*} {include file="public/head.html"} {*模板導航區(qū)廣告位*} {block name="advert1"} 模板導航區(qū)廣告位 {/block} {*模板內容區(qū)*} {include file="public/content.html"} {*模板內容區(qū)和廣告位*} {block name="advert2"} 模板主體內容廣告位 {/block} {* 底部內容版權信息*} {include file="public/footer.html" copyright="Powered by php中文網(wǎng) ?2008-2019 php中文網(wǎng) Inc."} </body> </html>
{*head.html 模板頭部內容*} <div class="head" style="width: 100%;height: 200px;background-color: #6da3da"> <span style="font-size: 30px; width: 100%; height: 200px; line-height:200px; display: block; text-align: center; ">我是頭部區(qū)域</span> </div>
{* content.html 模板中部正內容區(qū)域*} <div class="conternt" style="background-color: pink;width: 100%;height: 600px;margin-top: 5px;"> <span style="font-size: 30px; width: 100%; height: 200px; line-height:200px; display: block; text-align: center; ">我是內容區(qū)域</span> </div>
{*footer.html 模板尾部內容區(qū)域*} <div class="footer" style="width: 100%;height: 200px;background-color: #6da3da"> <span style="font-size: 30px;width: 100%;height: 200px;line-height:200px;display: block;text-align: center;">我是底部區(qū)域</span> <div style="text-align: center">{$copyright}</div> </div>
Correcting teacher:查無此人Correction time:2019-05-08 09:43:59
Teacher's summary:完成的不錯。懂的php模版多,對以后工作有幫助。繼續(xù)加油。