Yes, its a misunderstanding on your part. /member/account.{_format}/{id} 
only matches the right placeholder, when the left one matches. So it 
matches /member/account and /member/account.html 
and /member/account.html/123
but not /member/account/123 (no format).
A proposal of mine that would make your use case possible is 
at https://github.com/symfony/symfony/issues/5424. It also has some 
explanation that might help you.

Am Samstag, 13. Oktober 2012 00:33:50 UTC+2 schrieb David:
>
> I have some routes like this one (using annotation style) :
>
>     /**
>      * @Route("/account.{_format}/{
> id}", name="member_account_get", defaults={"id"="0","_format"="json"});
>      * @Method("GET")
>      */
>
> The controller class has a route prefix:
>
> /**
> * @Route("/member")
> */
>
> When I use php app/console router:debug: 
>
> member_account_get                   GET      
> /member/account.{_format}/{id}
>
> What I'm finding is that the default _format is not working, and I get a 
> 404 not found if I omit the .json.
>
> For example:
>
> app_dev.php/member/account/1007  does not work.
>
> It seems that in order for the default to work, the _format needs to come 
> at the end of the route, and in fact, for this particular method, I provide 
> "list" capability through the id default, and 
>
> app_dev.php/member/account  does work!
>
> Known issue? Workaround? Misunderstandings on my part?
>

-- 
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

Reply via email to