Library/Think/Http/Router.class.php
/**
     * Add a route group to the array
     * @param  array|string $group      The group pattern (ie. "/books/:id" , ['prefix' => "/books/:id", 'domain' => 'www.hhailuo.com'])
     * @param  array|null   $middleware Optional parameter array of middleware
     * @return int          The index of the new group
     */
Add a route group to the array
@param  array|string $group      The group pattern
@param  array|null   $middleware Optional parameter array of middleware
@return int          The index of the new group
Add a route group to the array @param array|string $group The group pattern @param array|null $middleware Optional parameter array of middleware @return int The index of the new group
public function pushGroup($group, $middleware = []) {
        if (is_array($group)) {
            $group             = array_merge(['prefix' => '', 'domain' => '', 'module' => C('DEFAULT_MODULE')], $group);
            $pattern           = $group['prefix'];
            $this->routeDomain = $group['domain'];
            $this->module      = $group['module'];
        } else {
            $pattern = $group;
        }
        return array_push($this->routeGroups, ['pattern' => $pattern, 'middleware' => $middleware]);
    }
public function pushGroup ( $ group , $ middleware = [ ] ) { if ( is_array ( $ group ) ) { $ group = array_merge ( [ 'prefix' => '' , 'domain' => '' , 'module' => C ( 'DEFAULT_MODULE' ) ] , $ group ) ; $ pattern = $ group [ 'prefix' ] ; $ this -> routeDomain = $ group [ 'domain' ] ; $ this -> module = $ group [ 'module' ] ; } else { $ pattern = $ group ; } return array_push ( $ this -> routeGroups , [ 'pattern' => $ pattern , 'middleware' => $ middleware ] ) ; }
Add a route group to the array
 @param  array|string $group      The group pattern (ie.
Add a route group to the array @param array|string $group The group pattern ( ie .