Creating file .xml from rss? |
[eluser]tnathos[/eluser]
Hi, i have a problem, in my site i have a feed rss and works fine.. in the controller i set the data and send to the view.. But i need call the .xml file so ho i can do? for example: http://mysite.com/feed -> works i need -> http://mysite.com/feed.xml TY
[eluser]Bas Vermeulen[/eluser]
Hi, Settings this in your application/config/routes.php should work: Code: $route['feed.xml'] = 'feed'; ps: don't forget to add the . to the $config['permitted_uri_chars'] @ application/config/config.php
[eluser]tnathos[/eluser]
ok but in this case i need get the response to the contoller "feed" and show using feed.xml..
[eluser]Bas Vermeulen[/eluser]
If my solution does not achieve what you want to achieve than I don't really understand you. Please elaborate on your question...
[eluser]tnathos[/eluser]
ok, i have an controller named "feed" this controller response a rss. for example http://mysite/feed Now i need get this response and shw using a file .xml for exmaple http://mysite/feed/rss.xml how i can create the file xml from the feed?
[eluser]Bas Vermeulen[/eluser]
Oh you want the output to be XML? Put this in your view, should work: Code: header("Content-Type: text/xml;charset=UTF-8"); Your feed controller should pull the data from a model and send it to the view, in the view you can then populate the xml feed with a simple foreach looping through your data array. I hope this does answer your question?
|
Welcome Guest, Not a member yet? Register Sign In |