Reputation: 727
PHPSlim version: 2.4.3
I would like to match an string against php slim router to know to which route it matches. ¿Is that possible? I couldn't find any "match" method exposed.
Example:
<?php
$match = $router->match("/party/create");
Upvotes: 1
Views: 119
Reputation: 4675
Slim already has a method for this:
$this->app->router()->getMatchedRoutes($httpMethod, $url);
More information: https://github.com/slimphp/Slim/blob/2.x/Slim/Router.php#L104
Upvotes: 1