SimplePie CakePHP Component

Posted by Matt on Mon, Jul 23 2007

CakePHP + SimplePieI'm working on a new design for my personal site, mcurry.net, part of which is basing the site on CakePHP. Although Cake is probably a little overkill in this situation, I've taken to using Cake for pretty much any site. The pretty urls alone make it worthwhile. And sites that start out as a single static page have a way of growing.

Part of the site is going to show the feed for this blog. SimplePie is the slickest PHP class for parsing RSS feeds. Using the class with Cake's vendor system was an easy call. While I was on the SimplePie site I came across a this component, which unfortunately wasn't up to date with the latest version of SimplePie.

I've updated the component to work with the SimplePie 1.0.1 and CakePHP 1.1 and 1.2. The updated SimplePie CakePHP component, along with instructions are now available.

Posted in Sandbox

7 Comments

Ryan Parman said on Jul 26, 2007
I've gone ahead and updated the old component with this one. Good job.

http://simplepie.org/wiki/plugins/cakephp/simplepie_module
Matt said on Jul 26, 2007
Hey Ryan,
I was going to contact you guys, but you found it first. SimplePie rocks. Keep up the great work.
Aaron Brethorst said on Nov 13, 2007
Hey - I'm trying to get Simplepie set up with CakePHP for a project I'm working on, but I'm getting an error (Class 'Folder' not found) in the Simplepie component. Do you know where this class is defined, and why I might be running into issues?

Thanks,
Aaron
Aaron Brethorst said on Nov 13, 2007
Oh, and this is on CakePHP 1.1.17.5612.
Aaron Brethorst said on Nov 13, 2007
Sigh. Never mind, solved it. It also turned out to be irrelevant since I don't want to use the caching features anyway.
Louie Miranda said on Nov 11, 2008
Hi, I am fixing up simplepie to only display 0,5 feeds.

However, I am having problems where to place this?
foreach ($feed->get_items(0, 5) as $item):

I believe, this should be placed on the view/ of cakephp, but I had problem extending simplepie up to the view/

Do you have any idea how I could make this work?

Thanks,
Louie
Matt said on Nov 11, 2008
Hey Louie,
The best way is retrieve the feed in your controller or model, then set the items so they can be displayed in your view. If you look at this example you'll see the controller code in step 5 and the view code in step 6.
-Matt

Add new comment