在當前模板下創建mifenlei.php即可自己構建方法
前提是必須對PHP有所了解 不了解的請先學習php
```
<?php
namespace template\mifenlei;
use app\index\controller\Index;
use think\Db;
// +----------------------------------------------------------------------
// | Copyright (c) 2021 http://mifenlei.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: @夢雨 <50361804@qq.com>
// +----------------------------------------------------------------------
// | 模板自定義擴展方法
// +----------------------------------------------------------------------
class mifenlei extends Index
{
// 訪問方法地址/view-模板標識-方法.html
// 得到地址你的域名/view-mifenlei-index.html 輸出我的第一個方法
public function index()
{
echo '我的第一個方法';
echo $this->view('index');//渲染模板當前模板下view創建index.html即可
}
}
```