abstract:layout模板文件<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title><{bl
layout模板文件
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title><{block name = "title"}>页面标题<{/block}></title> </head> <body> <{block name = "nav"}> 导航 <{/block}> <{block name = "content"}> 内容 <{/block}> <{block name = "copyright"}> 版权 <{/block}> </body> </html>
继承layout的模板文件
<{extends file = "layout.html"}> <{block name = "title"}> 模板的继承 <{/block}> <{block name = "nav"}> <{$smarty.block.parent}> <{* 调用模板里的内容 *}> <a href="">首页</a> | <a href="">关于我们</a> | <a href="">产品介绍</a> | <a href="">联系我们</a> <{/block}> <{block name = "content"}> <p>我的内容区域</p> <p>我的内容区域2</p> <p>我的内容区域3</p> <p>我的内容区域4</p> <{/block}> <{block name = "copyright"}> <h2>版权</h2> <{/block}>
Correcting teacher:查无此人Correction time:2019-09-05 14:39:48
Teacher's summary:完成的不错。框架可以让模版有逻辑,继续加油