Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get route list #247

Open
evilk123 opened this issue Dec 31, 2021 · 1 comment
Open

get route list #247

evilk123 opened this issue Dec 31, 2021 · 1 comment

Comments

@evilk123
Copy link

Hi
How to get all the routes defined?

@kktsvetkov
Copy link

I don't think you can. The routes passed to RouteCollector::addRoute() are immediately parsed and passed to the dataGenerator inside:

    public function addRoute($httpMethod, $route, $handler)
    {
        $route = $this->currentGroupPrefix . $route;
        $routeDatas = $this->routeParser->parse($route);
        foreach ((array) $httpMethod as $method) {
            foreach ($routeDatas as $routeData) {
                $this->dataGenerator->addRoute($method, $routeData, $handler);
            }
        }
    }

Perhaps if you extend RouteCollector and overwrite addRoute() you can collect the passed routes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants