HOW TO: Display RSS Feeds in your PRADO app


This guide will show you how to easily parse and display RSS Feeds in your php application no matter what framework you use. However, I will be using the PRADO framework for this demonstration. The Parser Since I’m a big fan of open-source software, I used MagpieRSS. MagpieRSS provides an XML-based (expat) RSS parser in PHP. The toolkit can be very easily integrated to your PHP application with just one line of code. Follow these steps to install the toolkit into your prado application:

  1. Download the toolkit from here.
  2. Create a folder within the protected folder of your application. You can name it anything you like. I’ll name it Common. Now your applications directory structure should look something like this
  3. Extract the contents of the package that you downloaded in the previous step into the Common folder.
  4. Now you will see a file named rss_fetch.inc. Rename that file to rss_fetch.php. I’ll explain why I did this in the next step.
  5. Include the rss_fetch.php file in your prado class and call the parser within a function as follows
  6. Prado Directory Structure

If we don’t rename rss_fetch.inc to rss_fetch.php in the previous step we cannot use the prado style include statement as shown in Line 1; Instead we have to use include_once(..). I did that just to maintain consistency in my coding style - no biggie ;)


visitor stats
Raihan Iqbal Original Theme By Mukkamu