-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[Proposal] Include route parameters as key/value pairs in Input #22
Comments
I'm curious about this. Though it does seem to break a fair bit of the routing that's in place now and I can't really see the advantage of using Ben |
Hi Ben, I don't want to remove route parameters as arguments. I was just looking for a unified way to access route parameters and user input because in some cases (that I'm working with) they're semantically similar. Something like The second half of my thought process was really the fact that the Request isn't injected into the Controller in any explicit way. The Request is held within the context of the Router and to access it one must appeal to the global App container and eg.
Anyway I feel like I've talked myself in circles. I can see how easy this will be to add to my BaseController so I might just go back to hacking around on my app until I clear up for myself what I'm really going on about :) |
Hmm. I have noticed that too, how you have no access to the request from a controller. It has been a bit annoying before for me too. Maybe that's it's own issue Sent from my iPhone On 15/01/2013, at 7:54 PM, stephenfrank [email protected] wrote:
|
I don't see a huge need for this at the moment. Thanks for the suggestion. |
This is a technique I'm using on a project recently and and find the idea to be useful.
Consider the route:
and the URL requested
This is my current implementation strung together but I'd expect the final implementation to be in the Router/Route classes somewhere... just to illustrate the idea:
The first payoff is that accessing route variables and input variables by the same method is convenient. Secondly, the controller and application becomes aware of the key/value pairs given by route (without using something ugly like
func_get_args()
in every single method call).The text was updated successfully, but these errors were encountered: