返回 创建布局模板 ...... 登陆

创建布局模板 生成页面

会上树的猪 2019-06-10 17:38:41 228

{//基础模板中容许出现block标签}
{block name="header"}
 {include file="public/header" /}
{/block}

{block name="main"}
 主体部分
{/block}

{block name="course"}
 课程名称:
{/block}

{block name="name"}
 杨林木
{/block}

{block name="fooder"}
 {include file="public/fooder" /}
{/block}





{extend name="base" /}
{//将父模板中的main区块进行重写}
{block name="main"}
 <h1>我是子模板的网站主体</h1>
{/block}

{block name="course"}
 {__block__}php编程
{/block}

{block name="name"}
 
{/block}

<!-- //子模板区块之外的模板忽略
父模板的原样输出 子模板中区块顺序无碍 -->



<style type="text/css">
 .header{
  margin: 0 auto;
  widows: 800px;
  height: 60px;
  text-align: center;
        background: red;
        line-height: 60px
 }
</style>
<div class="header">我是网站头部</div>




<style type="text/css">
 .footer{
  margin: 0 auto;
  widows: 800px;
  height: 60px;
  text-align: center;
        background: red;
        line-height: 60px
 }
</style>
<div class="footer">我是网站尾部</div>

最新手记推荐

• 用composer安装thinkphp框架的步骤 • 省市区接口说明 • 用thinkphp,后台新增栏目 • 管理员添加编辑删除 • 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消 回复 发送
  • PHP中文网