private function addRoute($types = '', $uri, $action = [])
    {

        if (is_string($action)) {
            $action = ['_controller' => $action];
        }

        if (is_array($action)) {
            if (isset($action['as'])) {
                AsCollector::addAs($action['as'], $uri);
            }
        }

        $types = (array)$types;

        foreach ($types as $type) {
            $type = mb_convert_case($type, MB_CASE_UPPER);

            $add = [
                'uri' => isset(static::$firing['when']) ? $this->createWhenUri($uri) : $uri,
                'action' => $action
            ];;

            // add group parameter to action variable
            if (isset(static::$firing['group'])) {
                $add['group'] = static::$firing['group'];
            }

            // add to collection
            static::$routes[$type][] = $add;
        }
        return $this;
    }
private function addRoute($types = '', $uri, $action = [])
    {

        if (is_string($action)) {
            $action = ['_controller' => $action];
        }

        if (is_array($action)) {
            if (isset($action['as'])) {
                AsCollector::addAs($action['as'], $uri);
            }
        }

        $types = (array)$types;

        foreach ($types as $type) {
            $type = mb_convert_case($type, MB_CASE_UPPER);

            $add = [
                'uri' => isset(static::$firing['when']) ? $this->createWhenUri($uri) : $uri,
                'action' => $action
            ];;

            // add group parameter to action variable
            if (isset(static::$firing['group'])) {
                $add['group'] = static::$firing['group'];
            }

            // add to collection
            static::$routes[$type][] = $add;
        }
        return $this;
    }
private function addRoute ( $ types = '' , $ uri , $ action = [ ] ) { if ( is_string ( $ action ) ) { $ action = [ '_controller' => $ action ] ; } if ( is_array ( $ action ) ) { if ( isset ( $ action [ 'as' ] ) ) { AsCollector :: addAs ( $ action [ 'as' ] , $ uri ) ; } } $ types = ( array ) $ types ; foreach ( $ types as $ type ) { $ type = mb_convert_case ( $ type , MB_CASE_UPPER ) ; $ add = [ 'uri' => isset ( static :: $ firing [ 'when' ] ) ? $ this -> createWhenUri ( $ uri ) : $ uri , 'action' => $ action ] ; ; // add group parameter to action variable if ( isset ( static :: $ firing [ 'group' ] ) ) { $ add [ 'group' ] = static :: $ firing [ 'group' ] ; } // add to collection static :: $ routes [ $ type ] [ ] = $ add ; } return $ this ; }
Add a route with type, uri and action parameters

@param string|array $types
@param array $uri
@param array $action
@return $this
Add a route with type uri and action parameters