Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Understanding the Zend Framework, Part 3: The feeds

Building the perfect reader

Tyler Anderson, Freelance Writer, Backstop Media
Tyler Anderson received his bachelor's degree in computer science in 2004 and his master's degree in electrical and computer engineering in 2005 from Brigham Young University. He worked with Stexar Corp. as a design engineer, R&D, from May 2005 to August 2006. Since his discovery by Backstop Media LLC in early 2005, he has written and coded numerous articles and tutorials for IBM developerWorks and DevX.com.

Summary:  This "Understanding the Zend Framework" series chronicles the building of an online feed reader, Chomp, while explaining the major aspects of using the recently introduced open source PHP Zend Framework. Parts 1 and 2 discuss the goals behind the Zend Framework and show you how to use it to create the beginnings of your online feed reader, creating a form and adding information to a database while getting to know the MVC pattern. In this tutorial, you will see how to use the Zend Framework to implement the online feed-reader portion of the application.

View more content in this series

Date:  18 Jan 2011 (Published 18 Jul 2006)
Level:  Intermediate PDF:  A4 and Letter (374 KB | 30 pages)Get Adobe® Reader®

Activity:  33270 views
Comments:  

Before you start

This tutorial is for developers who want to understand the Model-View-Controller (MVC) pattern, pushing beyond what is covered in Part 2, as well as how to build a feed reader using the Zend_Feed and Zend_Filter_Input modules of the Zend Framework.

About this series

This "Understanding the Zend Framework" series chronicles the building of an online feed reader, Chomp, while explaining the major aspects of using the recently introduced open source PHP Zend Framework.

Part 1 looked at the overall concepts of the Zend Framework, including a list of relevant classes and a general discussion of the MVC pattern. Part 2 expanded on that to show how MVC can be implemented in a Zend Framework application. You also created the user registration and login process, adding user information to the database and pulling it back out again.

Parts 3 and 4 deal with the actual RSS and Atom feeds. Here in Part 3, you enable users to subscribe to individual feeds and to display the items listed in those feeds. You will also look at some of the Zend Framework's form-handling capabilities, validating data, and sanitizing feed items. Part 4 explains how to create a proxy to pull data from a site that has no feed.

The rest of the series involves adding value to the Chomp application. In Part 5, you look at using the PDF format as a type of backup for saved entries. In Part 6, you use the Zend_Mail module to alert users to new posts. Part 7 looks at searching saved content and returning ranked results. In Part 8, you create your own mashup, adding information from Amazon, Flickr, Twitter and Yahoo! And in Part 9, you add Ajax interactions to the site using JavaScript object notation.


About this tutorial

In this tutorial, you add feeds into the equation, enabling the user to create an account, subscribe to particular feeds, and display those feeds. This tutorial uses the Zend_Feed and Zend_Input_Filter modules, the latter used to verify email addresses and strip HTML tags from feed entries. You will learn:

  • How to use the Zend_Input_Filter module to:
    • Filter incoming GET or POST data
  • About RSS feeds
  • How to use the Zend_Feed module to read data from RSS feeds
  • How to save, view, and delete feed entries to or from the database for later access

At the end of this tutorial, you will have the basic framework of the feed-reader application and be ready to start saving entire articles from non-RSS supporting websites to the database in Part 4.


Prerequisites

This tutorial assumes that you are familiar with PHP. (If you're not, see Resources for the "Learning PHP" tutorial series.) You should also have basic familiarity with how databases work, but you don't need to be an expert in the use of SQL (you'll be especially fine if you have completed Part 2 of this series). And you should also be familiar with RSS feeds.


System requirements

To follow along, you will need to have some pieces of software installed. Look back at Part 2 for details on installation and configuration of the following:

XAMPP
XAMPP is an easy-to-install version of Apache, MySQL, and PHP rolled into one. The version used for this tutorial (V1.7.3) contains Apache V2.2.14, PHP V5.3.1, and MySQL V5.1.41.
Zend Framework
This set of PHP classes is where all the work will be done. This tutorial was tested with V1.10.6.

1 of 11 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source
ArticleID=143743
TutorialTitle=Understanding the Zend Framework, Part 3: The feeds
publish-date=01182011
author1-email=tyleranderson5@yahoo.com
author1-email-cc=