How do I use the Zend framework

Zend Framework is an open source, object-oriented web application framework for 5. Zend Framework is often called a "component library" because it has many loosely connected components that can be used more or less independently. But Zend Framework also offers an advanced Model-View-Controller () implementation that can be used to provide a base structure for your own Zend Framework applications. A complete list of the components of the Zend Framework with a brief description can be found in the »Components Overview. This quickstart shows some of the most widely used components of the Zend Framework, including Zend_Controller, Zend_Layout, Zend_Config, Zend_Db, Zend_Db_Table, Zend_Registry, along with a few view helpers.

Using these components, we can build a simple database-driven guest book application in a few minutes. The complete source code for this application is available in the following archives:

So what is this pattern that everyone is talking about and why should it be used? is much more than just a three-word acronym () that you can mention whenever you want to appear smart; it is something of a standard in the creation of modern web applications. And for a good reason. Most web application code falls into one of three categories: presentation, business logic, and data access. The pattern models this separation very well. The end result is that the presentation code can be consolidated in one part of the application, the business logic in another part, and the data access code in another. Many developers find this well-defined separation essential to keep their code organized, especially when more than one developer is working on the same application.

grade: More information
Let's break up the pattern and look at the individual pieces:

  • model - This part of your own application defines the basic functionality in a set of abstractions. Data access routines and some business logic can be defined in the model.

  • View - Views define what exactly is presented to the user. Usually controllers pass data into each view so that it is presented in a format. Views also often collect data from the user. There you can usually find markup in your own application.

  • Controller - Controllers connect the complete pattern. They manipulate models, decide which view should be displayed based on the user request and other factors, transfer the data required by each view, or transfer control completely to other controllers. Most experts recommend »Keeping controllers as lean as possible.

Of course, there is »more to be said about this critical pattern, but what has been said should provide enough background to understand the guestbook application we are trying to build.