jump to navigation

Zend Framework : Creating a Feed Reader with 3 lines of code May 13, 2011

Posted by Tournas Dimitrios in Zend Framework v1.10.

I hope that you already know what a RSS Feed is , if not read my previous article and watch the webcast . In simple words , it’s a way for content publishers to distribute information about what’s new and interesting on a particular site , blog , forum . This information , which is typically a list of chronological ordered headlines , is published in XML format .

You can read RSS feeds  in a number of ways: everything from stand-alone applications, to Web-based portals, to support directly within your Web browser .  Reading Feeds  with the Zend Framework is really simple . Just  a few lines of code can build a web-based feed reader :


class FeedreaderController extends Zend_Controller_Action

    public function init()
        /* Initialize action controller here */

    public function indexAction()
	//Let's first disable the view rendering
	$channel = new Zend_Feed_Rss(


	echo "<h1> <center>
	The 10 most resent articles of my blog are :
      foreach ($channel as $item) {
          echo "<h3>".$item->title() ;




The Zend_Feed component provides an API to read and parse Feeds in the two most common formats vs RSS and Atom . You should not have to care whether the Feed is RSS or Atom , Zend’s module will handle that behind the scenes . Visit the home page and discover the API of this component .


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s