Thinkphp5 模塊的自動生成

  1. 首先到根目錄下的build.php文件中去 是這樣子滴:

 

  • 而後去public目錄中的index.php中去添加代碼 這樣子;

而後運行項目 就搞定了。 是否是美滋滋!php

 

在public 下index.php添加的代碼以下:ui

//這是build.php裏面的模板
'admin'     => [
        '__file__' => ['common.php'],
        '__dir__'  => ['behavior','controller','model','veiw','lang'],
        'controller' => ['Admin'],
        'model'     => ['Test'],
        'view'      => ['index/Index'],
    ],

//這是index.php下添加的代碼
$build = include '../build.php';
//運行自動生成
\think\Build::run($build);

  SEE YOU ARGIN!blog

相關文章
相關標籤/搜索