public function mainAction()
    {
        $infos = $this->getHttpRoutesInfos();

        $datas = [];
        foreach ($infos['routes'] as $route) {
            /** @var \Phalcon\Mvc\Router\Route $route */
            $paths = $route->getPaths();

            if (!$this->hasOption('no-substitution')) {
                $compiled = Helper::describeRoutePattern($route, true);
            } else {
                $compiled = $route->getPattern();
            }

            $httpMethods = $route->getHttpMethods();

            if (is_array($httpMethods)) {
                $httpMethods = implode('|', $httpMethods);
            }
            $middlewares = Arr::fetch($paths, 'middleware');
            if (is_array($middlewares)) {
                $_middlewares = [];
                foreach ($middlewares as $key => $middleware) {
                    if (is_int($key)) {
                        $_middlewares[] = $middleware;
                    } else {
                        $_middlewares[] = $key;
                    }
                }
                $middleware = implode('|', $_middlewares);
            } else {
                $middleware = $middlewares;
            }

            if (Arr::has($paths, 'controller')) {
                $controller = Str::capitalize($paths['controller']);
            } else {
                $controller = Decorate::notice('{controller}');
            }

            $controller .= Arr::fetch($infos, 'controllerSuffix', '');

            if (Arr::has($paths, 'action')) {
                $action = $paths['action'];
            } else {
                $action = Decorate::notice('{action}');
            }

            $action .= Arr::fetch($infos, 'actionSuffix', '');

            $module = Arr::get($paths, 'module');
            $namespace = Arr::fetch($paths, 'namespace', Arr::fetch($infos['defaults'], 'namespace'));

            $datas[$module . '::' . $namespace][] = [
                'domain'     => $route->getHostname(),
                'name'       => $route->getName(),
                'method'     => $httpMethods,
                'pattern'    => $compiled,
                'action'     => $controller . '::' . $action,
                'middleware' => $middleware
            ];
        }

        foreach ($datas as $key => $data) {
            $parts = explode('::', $key, 2);

            $this->table([['MODULE    : '.$parts[0]],['NAMESPACE : ' . $parts[1]]], [], Table::NO_HEADER);

            $this->table($data);

            $this->line('');
        }
    }
public function mainAction()
    {
        $infos = $this->getHttpRoutesInfos();

        $datas = [];
        foreach ($infos['routes'] as $route) {
            /** @var \Phalcon\Mvc\Router\Route $route */
            $paths = $route->getPaths();

            if (!$this->hasOption('no-substitution')) {
                $compiled = Helper::describeRoutePattern($route, true);
            } else {
                $compiled = $route->getPattern();
            }

            $httpMethods = $route->getHttpMethods();

            if (is_array($httpMethods)) {
                $httpMethods = implode('|', $httpMethods);
            }
            $middlewares = Arr::fetch($paths, 'middleware');
            if (is_array($middlewares)) {
                $_middlewares = [];
                foreach ($middlewares as $key => $middleware) {
                    if (is_int($key)) {
                        $_middlewares[] = $middleware;
                    } else {
                        $_middlewares[] = $key;
                    }
                }
                $middleware = implode('|', $_middlewares);
            } else {
                $middleware = $middlewares;
            }

            if (Arr::has($paths, 'controller')) {
                $controller = Str::capitalize($paths['controller']);
            } else {
                $controller = Decorate::notice('{controller}');
            }

            $controller .= Arr::fetch($infos, 'controllerSuffix', '');

            if (Arr::has($paths, 'action')) {
                $action = $paths['action'];
            } else {
                $action = Decorate::notice('{action}');
            }

            $action .= Arr::fetch($infos, 'actionSuffix', '');

            $module = Arr::get($paths, 'module');
            $namespace = Arr::fetch($paths, 'namespace', Arr::fetch($infos['defaults'], 'namespace'));

            $datas[$module . '::' . $namespace][] = [
                'domain'     => $route->getHostname(),
                'name'       => $route->getName(),
                'method'     => $httpMethods,
                'pattern'    => $compiled,
                'action'     => $controller . '::' . $action,
                'middleware' => $middleware
            ];
        }

        foreach ($datas as $key => $data) {
            $parts = explode('::', $key, 2);

            $this->table([['MODULE    : '.$parts[0]],['NAMESPACE : ' . $parts[1]]], [], Table::NO_HEADER);

            $this->table($data);

            $this->line('');
        }
    }
public function mainAction ( ) { $ infos = $ this -> getHttpRoutesInfos ( ) ; $ datas = [ ] ; foreach ( $ infos [ 'routes' ] as $ route ) { /** @var \Phalcon\Mvc\Router\Route $route */ $ paths = $ route -> getPaths ( ) ; if ( ! $ this -> hasOption ( 'no-substitution' ) ) { $ compiled = Helper :: describeRoutePattern ( $ route , true ) ; } else { $ compiled = $ route -> getPattern ( ) ; } $ httpMethods = $ route -> getHttpMethods ( ) ; if ( is_array ( $ httpMethods ) ) { $ httpMethods = implode ( '|' , $ httpMethods ) ; } $ middlewares = Arr :: fetch ( $ paths , 'middleware' ) ; if ( is_array ( $ middlewares ) ) { $ _middlewares = [ ] ; foreach ( $ middlewares as $ key => $ middleware ) { if ( is_int ( $ key ) ) { $ _middlewares [ ] = $ middleware ; } else { $ _middlewares [ ] = $ key ; } } $ middleware = implode ( '|' , $ _middlewares ) ; } else { $ middleware = $ middlewares ; } if ( Arr :: has ( $ paths , 'controller' ) ) { $ controller = Str :: capitalize ( $ paths [ 'controller' ] ) ; } else { $ controller = Decorate :: notice ( '{controller}' ) ; } $ controller .= Arr :: fetch ( $ infos , 'controllerSuffix' , '' ) ; if ( Arr :: has ( $ paths , 'action' ) ) { $ action = $ paths [ 'action' ] ; } else { $ action = Decorate :: notice ( '{action}' ) ; } $ action .= Arr :: fetch ( $ infos , 'actionSuffix' , '' ) ; $ module = Arr :: get ( $ paths , 'module' ) ; $ namespace = Arr :: fetch ( $ paths , 'namespace' , Arr :: fetch ( $ infos [ 'defaults' ] , 'namespace' ) ) ; $ datas [ $ module . '::' . $ namespace ] [ ] = [ 'domain' => $ route -> getHostname ( ) , 'name' => $ route -> getName ( ) , 'method' => $ httpMethods , 'pattern' => $ compiled , 'action' => $ controller . '::' . $ action , 'middleware' => $ middleware ] ; } foreach ( $ datas as $ key => $ data ) { $ parts = explode ( '::' , $ key , 2 ) ; $ this -> table ( [ [ 'MODULE    : ' . $ parts [ 0 ] ] , [ 'NAMESPACE : ' . $ parts [ 1 ] ] ] , [ ] , Table :: NO_HEADER ) ; $ this -> table ( $ data ) ; $ this -> line ( '' ) ; } }
List all routes.

@description List all routes.

@option      --no-substitution: Doesn't replace matching group by params name
List all routes .