Ajax, ZF and Smarty feed reader: part 1


In this series I will walk you through the code of a site that uses only Ajax and Scriptaculous to handle it’s completely windowed interface. Making an interface like this is not really good design, it’s only done here for the sake of teaching. It is kinda cool though. Especially if you have a big screen.

Download the Ajax, Zend and Smarty feed reader source.

To set the site up you have to:
1.) Unzip the source in your dev dir which you can access through http://localhost, it’s usually c:\wamp\www\. I will pretend that that is the directory from now on.
2.) Make sure you have a PEAR directory in the www dir.
3.) Se to it that you have the Smarty core directory called ‘libs’ inside the PEAR directory like this: PEAR\libs.
4.) Check that you have HTML Ajax in the PEAR\HTML directory.
5.) And lastly, don’t forget to put the Zend Framework inside the PEAR directory too, it should look like this: PEAR\Zend.
6.) Now you import ajax_tut.sql into a newly created database with the same name.

When that is done you are ready to use the application:
1.) Start with registering a new user.
2.) Login
3.) Create your favorite feeds and categorize them as needed.
4.) Open the list feeds window.
5.) Open the manage feeds window.
6.) Proceed by dragging the red up arrow of feeds you like to the big drop area that is shown in light blue. You have the picture below as your reference.
7.) Lastly, read your feeds by clicking the feed name in the manage feeds window.

feed reader with ajax interface


When you check the source you might realize that it isn’t as slick as the Marry the Zend Framework and HTML Ajax example. True, I made this application before I started doing things “the right way”. However, I trust that you can fill in the blanks yourself as to how code can be removed from the AjaxForm and AjaxRss classes into appropriate controllers, that will be your homework! :)

If this feels like too much for you then check out my first part on how to code a CMS/Community with Smarty and ZF. There are two good links there to newbie resources.

Related Posts

Tags: , , ,