Yes, thats exactly the same way like I do it also :-) Except the sfPropelRoute. But, like I wrote: This raises a 404 if the URL is called without suffix.... :-((
On 26 Mai, 12:19, Gábor Fási <[email protected]> wrote: > 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 <[email protected]> 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 [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-users?hl=en -~----------~----~----~----~------~----~------~--~---
