private function addRoute($method, $uri, $controller, $action)
    {
        // Prefix route uri, concat it and clear
        if (strlen($this->prefixUri) > 0) {
            $uri = $this->prefixUri . $uri;
            $this->prefixUri = '';
        }

        // Compatible: has no namespace
        if (strrpos($controller, '\\', 1) === false) {
            $controller = 'App\\Controllers\\' . $controller;
        }

        $items = $uri ? explode('/', ltrim($uri, '/')) : [];

        $this->routes[] = [
            'method'     => $method,
            'count'      => count($items),
            'controller' => $controller,
            'action'     => $action,
            'params'     => $items,
        ];
    }
private function addRoute($method, $uri, $controller, $action)
    {
        // Prefix route uri, concat it and clear
        if (strlen($this->prefixUri) > 0) {
            $uri = $this->prefixUri . $uri;
            $this->prefixUri = '';
        }

        // Compatible: has no namespace
        if (strrpos($controller, '\\', 1) === false) {
            $controller = 'App\\Controllers\\' . $controller;
        }

        $items = $uri ? explode('/', ltrim($uri, '/')) : [];

        $this->routes[] = [
            'method'     => $method,
            'count'      => count($items),
            'controller' => $controller,
            'action'     => $action,
            'params'     => $items,
        ];
    }
private function addRoute ( $ method , $ uri , $ controller , $ action ) { // Prefix route uri, concat it and clear if ( strlen ( $ this -> prefixUri ) > 0 ) { $ uri = $ this -> prefixUri . $ uri ; $ this -> prefixUri = '' ; } // Compatible: has no namespace if ( strrpos ( $ controller , '\\' , 1 ) === false ) { $ controller = 'App\\Controllers\\' . $ controller ; } $ items = $ uri ? explode ( '/' , ltrim ( $ uri , '/' ) ) : [ ] ; $ this -> routes [ ] = [ 'method' => $ method , 'count' => count ( $ items ) , 'controller' => $ controller , 'action' => $ action , 'params' => $ items , ] ; }
Base function, register routes

@param string $method
@param string $uri
@param string $controller
@param string $action
@return null
Base function register routes