This is how it's done in jobeet, day 15:

// apps/frontend/config/routing.yml
category:
  url:     /category/:slug.:sf_format
  class:   sfPropelRoute
  param:   { module: category, action: show, sf_format: html }
  options: { model: JobeetCategory, type: object }
  requirements:
    sf_format: (?:html|atom)


On Tue, May 26, 2009 at 12:04, halla <dha.maili...@googlemail.com> wrote:
>
> Hi everybody,
>
> I'm using different routes for my application, which also determine
> the response format (xml or json for an REST-based web service).
>
> This is an example rule in routing.yml:
>
> user_me:
>  url:                  /user/me.:sf_format
>  params:               { module: user, action: getUserMe }
>  requirements: { sf_method: GET, sf_format: (?:xml|json) }
>
> Is there a way to set sf_format to XML if NO .xml|json is given in the
> URL (the Suffix should be optional)? So that this ressource can be
> called via the  following URLs:
>
> (1) /user/me.xml -> XML-Response
> (2) /user/me.json -> JSON-Response
> (3) /user/me -> XML-Response
>
> Actually, a 404 is raised by symfony if the ressource is called via
> (3).
>
> Thanks for your help in advance,
> Daniel
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to