Zend Framework 1 Overview

Developing a PHP application requires domain knowledge, software engineering, discipline and time. We rarely write applications from scratch as there are freely available application frameworks that we can take advantage of. For PHP programming language, there are more than a dozen "popular" frameworks to choose from, and picking the right framework for your application is not a mundane task. I have been working as an IT consultants for many years, and Zend Framework is the one being discussed frequently. As a new php developer coming on board with a Zend Framework, I would like to use this forum to describe learning process.

What is Zend Framework?

Zend Framework is an object-oriented, loosely coupled and extensible framework, which adopts Model-View-Controller (MVC) implementation on PHP 5. Zend Framework is also known as a "glue" framework, because it has many loosely coupled components that you can use independently or use them together to take advantage of MVC design pattern. A full list of Zend Framework components and a complete programmer's reference are available at Component Library, and Programmer's Reference.

What are the advantages of using ZF?

Zend Framework is built on PHP5, and uses OOP design concept and implements a number of standard methods from the Standard PHP Library.

  • A framework is made up of loosely coupled component libraries.
  • Enterprise ready with large installed base and good documentation. (Corporate backing)
  • Uses OOP and design patterns including MVC, abstraction, and inheritance.
  • Flexible, Extensible, and scalable.
  • A framework built by a company who develops PHP language itself.

What are some of the drawbacks of using ZF?

I am not trying to discourage people from using Zend Framework, but based on my limited research there are a few drawbacks of using Zend Framework. Every framework has its pros and cons, and when you're evaluating a framework consider its advantages and disadvantages for your specific needs. There are a few popular PHP frameworks to choose from, and no matter what you choose it's better than building an application from scratch on your own. Some of the very popular PHP frameworks include Symphony, CodeIgniter, CakePHP, Yii, Kohana and Fusebox among others.

  • Steep learning curve
  • No scaffolding
  • No built-in models
  • Big footprint

Zend Framework Directory Structure

Upon successful creation of a project, zf command-line tool creates a basic site structure including the application controllers, views and unit test components. The directory structure looks something like below:

|-- application
|   |-- Bootstrap.php
|   |-- configs
|   |   +-- application.ini
|   |-- controllers
|   |   |-- ErrorController.php
|   |   +-- IndexController.php
|   |-- models
|   +-- views
|       |-- helpers
|       +-- scripts
|           |-- error
|           |   +-- error.phtml
|           +-- index
|               +-- index.phtml
|-- library
|-- public
|   |-- .htaccess
|   +-- index.php
+-- tests
    |-- application
    |   +-- bootstrap.php
    |-- library
    |   +-- bootstrap.php
    +-- phpunit.xml


Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.