<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                hinkphp5 官方提供了自動生成目錄功能,可以用來自動生成需要的模塊及目錄結構和文件等,自動生成主要調用\think\Build類庫。 默認的框架的根目錄下面自帶了一個build.php示例參考文件,內容如下: ~~~ return [ // 生成運行時目錄 '__file__' => ['common.php'], // 定義index模塊的自動生成 'index' => [ '__file__' => ['common.php'], '__dir__' => ['behavior', 'controller', 'model', 'view'], 'controller' => ['Index', 'Test', 'UserType'], 'model' => [], 'view' => ['index/index'], ], // 。。。 其他更多的模塊定義 ]; ~~~ 可以給每個模塊定義需要自動生成的文件和目錄,以及MVC類。 * * dir 表示生成目錄(支持多級目錄) * file 表示生成文件(不定義默認會生成 config.php 文件) * controller 表示生成controller類 * model表示生成model類 * view表示生成html文件(支持子目錄) 自動生成以APP_PATH為起始目錄,dir 和 file 表示需要自動創建目錄和文件,其他的則表示為模塊自動生成。 模塊的自動生成則以 APP_PATH.'模塊名/' 為起始目錄。 并且會自動生成模塊的默認的Index訪問控制器文件用于顯示框架的歡迎頁面。 因此,我們在 build.php 中做如下配置: ~~~ <?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 <liu21st@gmail.com> // +---------------------------------------------------------------------- return [ // 生成應用公共文件 '__file__' => ['common.php', 'config.php', 'database.php'], // 定義demo模塊的自動生成 (按照實際定義的文件名生成) 'demo' => [ '__file__' => ['common.php'], '__dir__' => ['behavior', 'controller', 'model', 'view'], 'controller' => ['Index', 'Test', 'UserType'], 'model' => ['User', 'UserType'], 'view' => ['index/index'], ], // 其他更多的模塊定義 // 商城模塊 'shop' => [ '__file__' => ['common.php', 'config.php'], '__dir__' => ['behavior', 'controller', 'model', 'view'], 'controller' => ['Index'], 'model' => [], 'view' => ['index/index'], ], ]; ~~~ >[warning] 運行下面的命令之前,確保你的 php命令行模式 可以運行。 > 首先進入系統的根目錄,默認會讀取應用目錄application下面的build.php 作為自動生成的定義文件,如果你的定義文件位置不同,則需要使用--config參數指定如下: ~~~ >php think build --config build.php ~~~ 表示讀取根目錄下的build.php文件。 輸入上面的命令,你會看到:Successed ![](https://box.kancloud.cn/b5d3472da006fceab696b78778a8a0d5_592x117.png) 此時,打開application目錄就可以看到創建的模塊了 ![](https://box.kancloud.cn/7b9d7b441f9aa8c2477afda0c9974d08_528x276.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看