Zend Framework

Zend Framework: building complete application using Zend_Session, Zend_Db and Zend_Auth

Posted by Faheem Abbas on July 4, 2009

Sorry this blog is deprecated. you can read full article here.

http://zendgeek.blogspot.com/2009/07/zend-framework-building-complete.html

Well, I have written lots of separate article on Zend Framework. Hopefully most of folk out there searching for valuable help may have gotten some from my articles.
This time my objective is to share everything with you, from basic configuration till to building complete Zend Framework application.
This article will cover
1. How to make initial configuration.
2. How to use Zend_Auth for authentication
3. Using Zend_Session for handling sessions
4. What are models and how to create them
5. Using Zend_Db to handle backend database for storing valuable information.
And much more.
So let’s get started.
1. Creating directory structure and making initial configuration
Zend Framework is based on MVC design patterns. MVC stands for Model, View, Controller. A simple definition of MVC design pattern is to separate business logic from presentation logic.
In order to work with Zend Framework MVC design pattern, you’ll need to make necessary directory structure. There are various ways of making directory structure, I, however will use the most easier to create and understand structure.

The structure I created is.

html_root
    /application
        /controllers
            IndexController.php
        /models
            Users.php
        /forms
            LoginForm.php
        /views
            /scripts
                /dojo
                    index.phtml
    /libaray
        /Zend
/js
    /css
    /images
    /index.phtm

On the top level we have html_root directory, containing application directory, library, js, css and images. It also contain index.phtml called our bootstrap file. This file contain all our configuration code. Further more application directory contain controller, models forms and views directories. Library directory contains Zend components. Js contain all our js files, css contains css files and images contains all images used in our application.

6 Responses to “Zend Framework: building complete application using Zend_Session, Zend_Db and Zend_Auth”

  1. Ravil said

    Zend_Loader::registerAutoload() is deprecated, why you still use it?

  2. Yes, I know its deprecated in 1.8, but i am currently using 1.7. I already have written about it in one of my article.
    Anyhow, Thanks for mentioning.

  3. Thomas M said

    Thanks for the Article. It’s nice to see articles with a full walk through (even if using depreciated parts of ZF 1.7). I’d like to see more on ZF 1.8 and the changes it brought.

  4. Chris K said

    You probably dont want to hear this but, any ideas on when you’re be moving to ZF 1.9? This is such as useful article but with version changes aricles can be really difficult for newbies to learn; hmm is this a typo, my code, or a new version change :(

  5. Erick Martinez said

    I think this is outdated, for ZF 1.9 you should take a look at http://framework.zend.com/manual/en/zend.application.quick-start.html

  6. ravi said

    nice tutorials..

    http://www.sakshieducation.info

    http://www.studentscorner.info

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>