public function group($group, callable $callback, array $options = [])
    {
        $options = array_merge([
            'as' => $group,
            'namespace' => $group
        ], $options);

        if (is_array($group)) {
            foreach ($group as $k => $p) {
                $this->group($p, $callback, [
                    'as' => $options['as'][$k],
                    'namespace' => $options['namespace'][$k]
                ]);
            }
            return $this;
        }
        $this->setGroupAs($options['as']);
        $group = $this->removeDuplSlash($group . '/');
        $group = $this->namedParameters($group, true);

        $this->matched($this->prepare($group, false), false);

        $this->currentGroup = $group;
        // Add this group and sub-groups to append to route uri.
        $this->group .= $group;
        // Bind to Route Class.
//        $callback = $callback->bindTo($this);
        $callback = Closure::bind($callback, $this, get_class());
        // Call with args.
        call_user_func_array($callback, $this->bindArgs($this->pramsGroup, $this->matchedArgs));

        $this->isGroup = false;
        $this->pramsGroup = $this->pattGroup = [];
        $this->group = substr($this->group, 0, -strlen($group));
        $this->setGroupAs(substr($this->getGroupAs(), 0, -(strlen($options['as']) + 2)), true);

        return $this;
    }
public function group($group, callable $callback, array $options = [])
    {
        $options = array_merge([
            'as' => $group,
            'namespace' => $group
        ], $options);

        if (is_array($group)) {
            foreach ($group as $k => $p) {
                $this->group($p, $callback, [
                    'as' => $options['as'][$k],
                    'namespace' => $options['namespace'][$k]
                ]);
            }
            return $this;
        }
        $this->setGroupAs($options['as']);
        $group = $this->removeDuplSlash($group . '/');
        $group = $this->namedParameters($group, true);

        $this->matched($this->prepare($group, false), false);

        $this->currentGroup = $group;
        // Add this group and sub-groups to append to route uri.
        $this->group .= $group;
        // Bind to Route Class.
//        $callback = $callback->bindTo($this);
        $callback = Closure::bind($callback, $this, get_class());
        // Call with args.
        call_user_func_array($callback, $this->bindArgs($this->pramsGroup, $this->matchedArgs));

        $this->isGroup = false;
        $this->pramsGroup = $this->pattGroup = [];
        $this->group = substr($this->group, 0, -strlen($group));
        $this->setGroupAs(substr($this->getGroupAs(), 0, -(strlen($options['as']) + 2)), true);

        return $this;
    }
public function group ( $ group , callable $ callback , array $ options = [ ] ) { $ options = array_merge ( [ 'as' => $ group , 'namespace' => $ group ] , $ options ) ; if ( is_array ( $ group ) ) { foreach ( $ group as $ k => $ p ) { $ this -> group ( $ p , $ callback , [ 'as' => $ options [ 'as' ] [ $ k ] , 'namespace' => $ options [ 'namespace' ] [ $ k ] ] ) ; } return $ this ; } $ this -> setGroupAs ( $ options [ 'as' ] ) ; $ group = $ this -> removeDuplSlash ( $ group . '/' ) ; $ group = $ this -> namedParameters ( $ group , true ) ; $ this -> matched ( $ this -> prepare ( $ group , false ) , false ) ; $ this -> currentGroup = $ group ; // Add this group and sub-groups to append to route uri.
 $ this -> group .= $ group ; // Bind to Route Class.
 //        $callback = $callback->bindTo($this);
 $ callback = Closure :: bind ( $ callback , $ this , get_class ( ) ) ; // Call with args.
 call_user_func_array ( $ callback , $ this -> bindArgs ( $ this -> pramsGroup , $ this -> matchedArgs ) ) ; $ this -> isGroup = false ; $ this -> pramsGroup = $ this -> pattGroup = [ ] ; $ this -> group = substr ( $ this -> group , 0 , - strlen ( $ group ) ) ; $ this -> setGroupAs ( substr ( $ this -> getGroupAs ( ) , 0 , - ( strlen ( $ options [ 'as' ] ) + 2 ) ) , true ) ; return $ this ; }
Group of routes.

@param string|array $group
@param callable $callback

@param array $options
@return $this
Group of routes .