Zend Framework 1.5 Released

Zend has finally released the 1.5 version of their Framework. I have been using their Release candidates for a little over a month now and am very excited that they have hit this milestone. Check out http://framework.zend.com to download the framework, and read tutorials on setting it up and using it. They also have video tutorials. One bitt of advice after briefly reading their new Quick Start Guide. The author has us using ‘require_once’ on his controller class files, where instead we can better use the Zend_Loader which is instantiated in your bootstrap file, to autoload the classes, that way you call them anywhere in your project, without worrying about loading them.

Here is the original code:

IndexController.php

require_once 'Zend/Controller/Action.php';

class IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
    }
}

We can remove the ‘require_once’ line, and then we need to set up the Zend Autoloader which can be done in your bootstrap file as follows:

index.php


...
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
...

I am not saying that my way is the ‘right’ way, but this might help streamline the design of your project, and remove some un-necessary ‘includes’. You can also load a class using the Zend_Loader by calling:

...
Zend_Loader::loadClass('CLASS NAME');
...

All of the tutorials are great. Maurice Fonk has some great insight into ZF, and has a great article on Integrating Smarty Templating Engine into ZF. Rob Allen’s blog also has some great stuff.

1 comment so far

  1. Wil Sinclair March 17, 2008 2:51 pm

    The QuickStart unfortunately didn’t make it in to a final state for the release. I’ll be working on that through the day. I’ll keep this feedback in mind, and if you have any other feedback please comment on the QuickStart itself. I fully expect it to take a few days for people in the community to vet the QS; that’s why I have left it on the wiki for now. We will move it over to the main site with better formatting soon.

    ,Wil

Leave a comment

Please be polite and on topic. Your e-mail will never be published.