Hey, that's also what I need. I made it work in sf1.4 but it was only
hacked together. As far as I see such functionally is also not
prebuilt in sf2.
Thats a pity because its a regular use case.
I imagine a custom route which supports to specify all available
formats and then returns the most appropriate according to "Accept"
header.
It should also include the "Content-Location" header in the response
and allow generic URI which have the "Vary" response header.
Example:

article_show:
  class: ContentNegotiationRoute
  pattern:  /articles/{year}/{title}.{_format}
  defaults  { _controller: AcmeDemo:Article:show, _format: html }
  requirements:
      _format:  html|rss|json
      year:     \d+

So "/articles/2011/title" would return 200 with Content-Location "/
articles/2011/title.html" and Vary: Accept
And the format requirement can be used to specify all available
formats for this route.
And the URL-generator needs to return the generic URI when no format
specified.


On 29 Mrz., 02:01, raviu <ravi.undupit...@gmail.com> wrote:
> Hi,
>
> I'm embarking on a project where I require one URL to provide multiple
> formats of a document. The document should be served depending on the
> "Accept" field of the HTTP header. HTML or RDF. I know this can be
> done using apache mod_rewrite.
>
> Just want to know if this functionality is supported by Symfony and if
> so is it as simple as updating a htaccess file?
>
> Thanks,
> Ravi

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