代码 application\index\controller\index.php

<?php
namespace app\index\controller;
use app\index\controller;

class Index extends IndexBase
{
    public function index()
    {

        return $this->fetch();
    }

    public function base ()
    {
        return $this->fetch();
    }
}

模板application\index\view\index\index.html

{extend name="index/base" /}
{block name="title"}
Title:
{/block}
{block name="right"}
最新资讯:
{/block}

{block name="footer"}
{__block__}@ThinkPHP 版权所有
{/block}

 

模板application\index\view\index\base.html

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>{block name="title"}标题{/block}</title>
</head>
<body>
{block name="menu"}菜单{/block}
{block name="left"}左边分栏{/block}
{block name="main"}主内容{/block}
{block name="right"}右边分栏{/block}
{block name="footer"}底部{/block}
</body>
</html>

 

输出结果:菜单 左边分栏 主内容 最新资讯: 底部@ThinkPHP 版权所有

 

注意:{__block__} 

 

相关文章:

  • 2021-12-22
  • 2022-01-16
  • 2022-02-07
  • 2021-08-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-06
  • 2022-03-09
  • 2022-01-17
  • 2021-05-27
相关资源
相似解决方案