Creating file .xml from rss?

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

i need ->


[eluser]Bas Vermeulen[/eluser]

Settings this in your application/config/routes.php should work:

$route['feed.xml'] = 'feed';

ps: don't forget to add the . to the $config['permitted_uri_chars'] @ application/config/config.php

ok thabks i go to test

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


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:
header("Content-Type: text/xml;charset=UTF-8");
    $sitemap = '<?xml version="1.0" encoding="UTF-8"?>
            <urlset xmlns:xsi=""
    echo $sitemap;

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?

thanks, i try test Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.