-
Notifications
You must be signed in to change notification settings - Fork 444
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
Active route pattern #225
Comments
I'm not sure what you mean? You want to be able to get the matched pattern in the result? |
Exactly, be able to identify used route "rule", for general purposes like statistic/analytics |
@Jackson88 the router builds a regex-map internally I don't think the current version allows you to identify the used route declaration but I'm working towards being able to do so in #233 |
@Jackson88 you can just use Google Analytics or the PSR request object and it's URL itself to generate statistics. I don't see how a route itself gives you good statistics. |
@Jackson88 can you use the handler instead of the route to track the states? In other words, instead of tracking how many times the route was matched, you are going to track how many times the handler was returned as result. In most cases, if there are no duplicate routes for the same handler, it should do the job. |
In Symfony Routing there is this feature called "Extra Parameters", where when you declare a route you not only assign a handler to it, but you can also attach some extra parameters that will be included in the results if the route is matched. I think under the hood this is what Symfony Routing is using to remember the route names as well. I think such a feature here will help both with the named routes, as well as with any other baggage that you want to pass along with a route that has been matched. |
"extra parameters" would be really cool. that would make life SOOO much easier with auth middleware. |
Hello, kinda question: is it possible to define the active route pattern itself, for example:
Regards.
The text was updated successfully, but these errors were encountered: