On 03.08.2011 11:55, José Jorge Vieira wrote:
> Is it possible, with symfony2, to have the same routing pattern but
> different methods and regex to validate the params to each method?
> This is not working for me..
>
> Example:
>
> test_update_stuff:
> pattern: /dummy/dummy2/{id}
> defaults: { _controller: WhateverBundle:Dummy:updateDummy }
> requirements:
> _method: PUT
> id: .+
>
> test_delete_stuff:
> pattern: /dummy/dummy2/{ids}
> defaults: { _controller: WhateverBundle:Dummy:deleteDummy }
> requirements:
> _method: DELETE
> ids: ^\d+(,\d+)*$
>
> i know that it makes sense that the "id" and "ids" should be the same
> type on both PUT and DELETE methods,
> but i'm just wondering if it possible to do like so ;-)
It should work, though indeed it's not a good idea. But if you have all
the routes already, why don't you just try it? :)
Cheers
--
Jordi Boggiano
@seldaek - http://nelm.io/jordi
--
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 symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en