xmlsymfonyrsssymfony1

How to force symfony route to have xml extension?


Our client is using Symfony 1.2 in his website. He requested to create XML RSS Feeds page for his blog post. I did created the RSS feeds but the problem is with the route! I want the route to be rss.xml but now the route is /rss only. How can i force it to load the feeds on /rss.xml route i.e with xml extension

Routing:

blog_rss:
  url:   /rss
  param: {module: blog, action: rss, sf_format: xml}

I also created an action

 public function executeRss(sfWebRequest $request) { }

And template

templates\rssSuccess.xml.php

Solution

  • Symfony 1.2 is severly outdated... but anyways: just extend the route definition:

    blog_rss:
      url:   /rss.xml
      param: {module: blog, action: rss, sf_format: xml}