views:

35

answers:

1

I went through the Book and I've copied code from the section http://book.cakephp.org/view/1460/RSS but can't get this to work: I end up with a zero byte file (index.rss) being offered for download by my broswer, instead of xml output.

I have narrowed the error down to this piece of code (in app/views/posts/rss/index.ctp):

$postLink = array(
        'controller' => 'entries',
        'action' => 'view',
        'year' => date('Y', $postTime),
        'month' => date('m', $postTime),
        'day' => date('d', $postTime),
        $post['Post']['slug']
    );

... specifically 'controller'=>'entries' throws an error. But there is no mention of setting up a controller called entries in the tutorial, or indeed a view for such a controller. Can anyone point me in the right direction?

+1  A: 

$postLink in the example is used to create a link to a post in the rss feed. Change the $postLink so that it will point to a single post, use your own controller. You may find it easier to pass a string, for example /posts/view/1.
The syntax is same as described here: http://book.cakephp.org/view/1448/url .

Adam
Thanks - thought I might be missing some information when in fact I was just suffering from dumbness :-)
Mark Flint