CakePHP 1.2 RSSHelper example
There seems to be precious little information out there regarding CakePHP 1.2’s RSSHelper. so here is a quick how-to:
Controller:
function rss() {
$this->layoutPath = 'rss';
$this->Appointment->recursive = 0;
$this->set('data', $this->Appointment->findAll());
$this->set('channel', array('title' => "Recent Appointments",
'link' => "/appointments/rss",
'description' => "Recently Booked Appointments" ));
}
View:
function xformRSS($data)
{
return array('title' => "New Appointment",
'link' => "/appointments/view/" . $data['Appointment']['id'],
'guid' => "/appointments/view/" . $data['Appointment']['id'],
'description' => $data['Appointment']['description'],
'pubDate' => $data['Appointment']['created']);
}
echo $rss->items($data, 'xformRSS');
Popularity: 22% [?]







Hi there,
I’ve got a problem using the RssHelper as mentioned in your post above.basically I get this Fatal error:
“Fatal error: Call to undefined method XmlElement::header() in /home/hwz/www/cake/cake1.2.0.7296RC2/cake/libs/view/helpers/xml.php on line 73″
is something wrong with my Core?is it a beta bug?
Cheers!
Aeshan