Part 1 - The idea, the planning and other starting stuff

The idea of writing this “not a tutorial, but rather step-by-step sample application buidling document” arose in my head recently while playing with the Zend Framework and building my own “quick-start” or “kick-start” code to use in my projects. I was insipred by the Pádraic Brady’s “Example Zend Framework Blog Application Tutorial” series in his blog, which unfortunately went offline recently, but I hope he will be able to bring it back online soon, because it is really great resource. While he is building blog application, my approach will be different to his - I’ll show here how to build something very simple, but needed in great amount of websites - user registration, confirmation of the registration by email, lost password functionality, profile editing and simple user administration.

In fact my purpose is to show how to use different parts of the Zend Framework and how they are used together. My purpose is to build a code, which can be used immediately in any serious web project I start. I won’t explain here what is MVC and why we use it or what is Table Data Gateway pattern or Row Data Gateway, implemented in the Zend_Db_Table and Zend_Db_Table_Row classes. There are better sources for this kind of information for sure. Neither I will give much explanation for the different possibilities provided by the Zend Framework and the different ways to accomplish some task - in general Zend Framework provides at least a couple of ways to do one and same thing very often. And the visual design of the resulting webpages we develop won’t be something very good looking. I will stick to very simple design, allowing to concentrate on the Zend Framework part of our application and allowing the flexability to use any design we need in the future.

Now, after it is clear what you won’t find in this series, may be it is time to tell you what exactly you will find. We will use Zend_Controller, Zend_View and Zend_Layout classes to implement our MVC based site. Zend_Registry, Zend_Db_Table, Zend_Config, Zend_Form, Zend_Acl, Zend_Auth, Zend_Mail, Zend_Translate, Zend_Session - all these classes we will use in our application. The functionality we will design and implement is rather simple and I’ll outline it below.

  • registration page with registration form, where visitors can enter nickname, password and email address and to become registered member of our web site. We can add possibility to fill in some of the profile fields like gender and birthdate here also. The form will be secured by CAPTCHA. Other improvement we can make here is to add auto testing if the choosen nickname is free (not already taken) with AJAX request, but i’m not so sure if I want to add AJAX library to this and while writing the needed JS from scratch is no option here - this feature is not sure for now.
  • after our site visitor submit the registration form an email message will be sent to his email address with activation link, which he should visit in order his account in our site to be active
  • we will then build login form, from which our newly registered users can use to enter in the “private” section of our site
  • functionality for allowing to retrieve lost password will be available
  • profile editing options and profile preview page will be available
  • simple user administration for the site administrator will be build

 

In Part 2 of this series we will go through the process of setting up the directory structure, MVC foundations and writing the Bootstrap file for our project.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Fark
  • Furl
  • Live
  • Ma.gnolia
  • Reddit
  • Spurl
  • Technorati