0
votes

I've created an RSS feed with the RssHelper as in http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html. It is located at app/View/Posts/rss/index.ctp and is accessible at /posts/index.rss It shows RSS feeds from Posts.

I have also created RSS feed for other controllers like news, events etc. I want to let users subscribe to RSS feed that shows all the feeds from other contollers like news, events etc. That is I want to combine RSS feeds from different controllers.

Please help. Thanks in advance.

1

1 Answers

0
votes

Within any Controller's action, you can load other models - for example, in your PostsController, something like this:

//PostsController
public function rss_combined() {
    $this->loadModel('Event');
    $this->loadModel('News');
    //do whatever logic you want to create a combined RSS
}

Or, if the models are associated with the Post model, you can access methods through the Post model:

// Instead of this:
$this->loadModel('Event');
$this->Event->myMethod();

// You can do this:
$this->Post->Event->myMethod();

Often I create a DashboardsController or something of the like when I need many things that aren't tied directly to a specific model. Then, you can specify that the Dashboard model doesn't use a database table:

public $useTable = false;