使用TP5.1自定义模板,并继承!
{// 公用模板}
{block name="header"}
{include file="public/header" /}
{/block}
{block name="content"}
内容主体部分
{/block}
{block name="footer"}
{include file="public/footer" /}
{/block}
{// 先继承父模板}
{extend name="public"}
{//重写主体内容部分}
{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>这里是内容部分</p>
<p>我正则学习ThinkPhp的模板继承</p>
</div>
{/block}
