<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 分組路由 分組路由可以把相同的信息或者相同的前綴放到同一個分組里可以提供匹配速度,該路由組件支持無限級子組,當然也不套太多層級,遞歸也是需要速度的。 [TOC] #### 參數 ~~~ /** * 分組路由 * @param [array] $option [條件選項] * @param [array] $route [路由地址 二維數組或者是一個閉包函數] * @param [string] $method [請求方法] * @param [array] $pattern [條件] * @param [array] $name [分組名稱] * @param [array] $pattern [匹配模式] * @param [array] $behavior[匹配后的行為] * @return [object] [$this] */ public function group($option, $route, $method = 'any', $pattern = [], $name = '', $behavior = []) ~~~ 示例: ~~~ $route = [ 'testgroup/{id}' => ['route' => 'index/index/create', 'where' => ['id' => '(\d{1})'], 'option' => [],'behavior'=>[]], 'testgroup/{uid}' => ['route' => 'index/index/delete', 'where' => ['uid' => '(\d{2})'], 'option' => [],'behavior'=>[]], 'testgroup/{aid}' => ['route' => 'index/index/update', 'where' => ['aid' => '(\d{3})'], 'option' => [],'behavior'=>[]], ]; Route::group('['prefix' => 'testgroup', 'method' => 'get']',$route, 'get' ); ~~~ 在配置文件可以這樣寫 ~~~ // 分組路由 'group' => [ [ ['prefix' => 'testgroup', 'method' => 'get'], [ 'testgroup/{id}' => ['route' => 'index/index/create', 'where' => ['id' => '(\d{1})'], 'option' => [],'behavior'=>[]], 'testgroup/{uid}' => ['route' => 'index/index/delete', 'where' => ['uid' => '(\d{2})'], 'option' => [],'behavior'=>[]], 'testgroup/{aid}' => ['route' => 'index/index/update', 'where' => ['aid' => '(\d{3})'], 'option' => [],'behavior'=>[]], ], 'get', ], ], ~~~ 無限遞歸方式: 其實路由分組的注冊方法是簡介的調用了rules方法 如果rules方法的第一個參數為空,那么當前這一條路由規則的鍵名并不是批評規則,而是數字,系統判斷如果鍵名為數字表示一個分組路由,所有這樣間接的實現的無限子級。 ~~~ // 分組路由 'group' => [ // 一個分組路由 [ ['prefix' => 'testgroup', 'method' => 'get'], // 分組路由第二個參數 路由規則 如果直接是規則就直接匹配如果想下面一一是一個二維數組就遞歸 [ [ 'option'=>['prefix' => 'testgroup', 'method' => 'get'], 'route'=>[ 'testgroup/{id}' => ['route' => 'index/index/create', 'where' => ['id' => '(\d{1})'], 'option' => [],'behavior'=>[]], 'testgroup/{uid}' => ['route' => 'index/index/delete', 'where' => ['uid' => '(\d{2})'], 'option' => [],'behavior'=>[]], 'testgroup/{aid}' => ['route' => 'index/index/update', 'where' => ['aid' => '(\d{3})'], 'option' => [],'behavior'=>[]], ], 'where' => [], ] ], 'get', ], ~~~ 所以總的來說,路由分組不必調用分組方法,調用get post delete put any rules方法一樣可以實現 ### 注意 如果使用路由分組并且存在子組由那么子組路由的參數必須齊全
                  <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>

                              哎呀哎呀视频在线观看