Hi! I'm new to cake and doing my first privat project with it (http://www.larp-welt.de). For this I looked for a way to show rss feeds from homepages of friends on my homepage.
I browsed the bakery for a solution, but found none I realy liked. So I wrote my own. In my opinion a behaviore or a component is not the right way, because there is no difference in a rss-feed and a read only database for me. OK, the queries are much more simple. I want to share my solution with you. Please tell me, if it is a good one, or a bad one! I came up with a datasource, I'm attaching it to this mail. It uses lastRSS (http://lastrss.oslab.net/). Of course some code is taken from the bakery. No I can setup the rss feeds in conf/database as follows: var $larpkalender = array( 'datasource'=>'rss', 'url'=>'http://www.larpkalender.de/rssfeed.rdf', 'cacheTime'=>6 ); After setting up a simple model: class Larpkalender extends AppModel { var $name = 'Larpkalender'; var $useTable = false; var $useDbConfig = 'larpkalender'; } I can now use the rss feed in a controller, and generate views for it, or using it in a requestAction inside other models views. This is my controller: class LarpkalendersController extends AppController { function index() { $data = $this->Larpkalender->find('all'); return $data['items']; } } I don't know, if this is a clever or a good way, but I like it. In my opinion the rss feed is a datasource, and I like the easy way to get it via find() in my controller. Bye Marcus --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
rss_source.php
Description: application/php
