On 27.04.2011, at 22:10, Lukas Kahwe Smith wrote: > > On 27.04.2011, at 22:07, Jordi Boggiano wrote: > >> On 27.04.2011 21:42, Lukas Kahwe Smith wrote: >>> >>> On 27.04.2011, at 21:40, Fabien Potencier wrote: >>> >>>> On 4/27/11 9:26 PM, Jordi Boggiano wrote: >>>>> Thinking about it some more, maybe the routes should not check that at >>>>> all, you could use annotations on the action and then a >>>>> core.controller (is there such a thing?) event listener to check based >>>>> on the request headers + what is defined on the action for supported >>>>> formats then decide whether the request is acceptable or not, and if >>>>> yes, set the preferred request format. >>>> >>>> Sounds much better to me. >>> >>> >>> But this means that the route is already matched. Which means you cannot >>> automatically fallback to a route that better matches. >> >> core.controller can modify the controller to be executed, so in theory >> you *could* one way or another, but I guess that may be expensive. > > > its also inventing another concept where a better one already exists. > anyway, i guess i will just need to then override router.real to do what is > necessary.
Just FYI: over lunch Jordi convinced me of the ControllerListener approach: https://github.com/FriendsOfSymfony/RestBundle/compare/controller_listener The idea is that any controller action will be able to override the global priorities. In case no match between the Request's Accept header and the priorities can be found a 406 will be triggered. In case of the edge case where another route should be triggered the action in question will have to add */* to its priorities and then do a manual forward() to the proper action. regards, Lukas Kahwe Smith [email protected] -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
