Tp5中配置多模塊開發

  1. 配置項目根目錄下的build.php文件該文件內容如下:
    1. <

      <?php
      // +----------------------------------------------------------------------
      // | ThinkPHP [ WE CAN DO IT JUST THINK ]
      // +----------------------------------------------------------------------
      // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
      // +----------------------------------------------------------------------
      // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
      // +----------------------------------------------------------------------
      // | Author: liu21st <[email protected]>
      // +----------------------------------------------------------------------
      
      return [
          // 生成應用公共文件
          '__file__' => ['common.php', 'config.php', 'database.php'],
      
          // 定義api模塊的自動生成 (按照實際定義的文件名生成)
          'api'     => [
              '__file__'   => ['common.php','config.php','database.php'], // 生成的配置文件
              '__dir__'    => ['behavior', 'controller', 'model', 'view'], // 生成文件夾
              'controller' => [], // 生成控制器
              'model'      => [], // 生成模型層
              'view'       => [], // 生成視圖
          ],
          // 其他更多的模塊定義
      ];
  2.  配置好上面的文件後在項目的根目錄執行命令
    1. php think build --config build.php   ----> 用於生成模塊

       

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章