您当前的位置: 首页 > 学无止境 > 网站建设 网站首页网站建设
thinkphp模版使用技巧2
发布时间:2015-12-28 07:44:11编辑:雪饮阅读()
渲染模版layout中也可以使用include包含其它模版的公共内容:
<include file="Public:header"/>
模版的继承:
父模版相当于抽象类,子模版相当于抽象类的具体每一个接口的实现。抽象类只是一个抽象的概念,继承抽象类实现其每个接口。
<block name="top">top</block>
<div style="text-align:center;margin:0 auto;">雪饮个人博客</div>
<block name="body">article</block>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<extend name="Public:base"/>
<block name="top">
<include file="Public:header"/>
</block>
</head>
<body>
<block name="body">
{__CONTENT__}
</block>
</body>
</html>
关键字词:thinkphp,模版,个人博客
上一篇:thinkphp模版使用技巧