I guess the idea is that the index page and the index RSS feed should  
very much contain the same data, only in a different output format  
(layout/view). You can use a paginate() call even for the RSS feed, as  
you usually only want the last x entries in the feed, not the whole  
database. You can ask the RequestHandler component whether the page is  
supposed to be RSS or regular, and increase the limit for the paginate  
call for example, or set other differentiating options.

If the RSS version is supposed to be completely different from the  
regular page, just name it something else like feed.rss and have a  
dedicated feed() action in your controller for it.

On 26 Nov 2008, at 14:28, aranworld wrote:

>
> Well, I realize it is a pretty dumb question.  Obviously, the index()
> method is called when index.rss is accessed.
>
> I guess my real question is ... what if the logic behind index.rss is
> different from the logic behind index ... as I'm sure it usually is on
> websites.
>
> For example, what if my posts/index uses paginate?  How could I make a
> controller action called index, that handled both an rss request and a
> regular request, using different logic for each one?
>
> -Aran
>
> On Nov 25, 2:07 pm, aranworld <[EMAIL PROTECTED]> wrote:
>> I am finding the manual entry on generating RSS Feeds really helpful
>> except for one minor detail.
>>
>> http://book.cakephp.org/view/483/Creating-an-RSS-feed-with-the-RssHelper
>>
>> When someone requests posts/index.rss , what controller method is
>> actually called?  Is Posts::index() called?
>>
>> Where should I put the Controller Code that appears?  If I put it in
>> Posts::index(), then how do I integrate it with other code for
>> generating a non-rss feed from Posts::index()?
>>
>> Thanks,
>> Aran
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to