Zend Framework 1.8 Workshop

Hello Everybody,

today I gave a workshop at Skynet Belgacom on how to use the new features in Zend Framework: Zend_Application and Zend_Tool. Also a quick overview on how to use a DAO to separate the database from the model. The DAO and the model are kept very basic so everybody attending the workshop could understand the principle behind such a design principle.

I also gave an introduction to Zend_Auth and implemented a custom Zend_Auth_Adapter_Interface which could have been the Zend_Auth_Adapter_DbTable but that wouldn’t have teached my fellow colleagues on how extensible ZF really is…

Beneath I share the slides from this workshop. If you do it step by step at the end you will have a running ZF application based on modules.

have fun,

Nick Belhomme

9 comments

  1. abadaba says:

    This is a great tutorial. I like the way you seperated the db actions into a DAO. When can we expect your next tutorial regarding ACL and the logged in members module? 🙂 Thanks!

  2. abadaba says:

    Looking forward to it…
    I have one question. You created the UserDB model and DAO under the admin module. Wouldn’t it be more reusable if you put it somewhere where both the Default and Admin modules can access it so that you don’t have to re-write it for every module? Maybe I’m confused on this…
    Thanks…

  3. Nick says:

    Rewriting for every module is not necessary. Every module has access to the models of others. But indeed it would be best to put it on another place. Remember these are slides that should be accompanied with explanations. During the workshops I elaborate deeper into the issue. Without the explanations you will have to do some thinking on your own. And it seems you do that. GREAT! Keep up the good work.

    Nick
    Nick

  4. thatch says:

    Hi There,

    I’ve noticed a problem that stems from slide #26 when issuing the following commands via zf:

    $ zf create action add index 1 admin
    $ zf create action edit index 1 admin
    $ zf create action delete index 1 admin

    I am getting the following error:
    Fatal error: Call to a member function search() on a non-object in C:\wamp\library\Zend\Tool\Project\Provider\Action.php on line 92

    I have googled this and came to the following bug on zend’s bugtracker:

    http://framework.zend.com/issues/browse/ZF-6585

    however there is no fix.

    Any suggestions?
    Thatch

  5. thatch says:

    Hi Again,

    Just noticed on slide #36

    $users->update($username, $pwd, $firstname);

    should be

    $users->update($id,$username, $pwd, $firstname);

  6. Behrang says:

    First thanks for your helpful tutorial,
    second when I go to http://localhost/myprogect/admin I get this error:
    Message: Invalid controller specified (index)
    what you think about it? I’m using zf 1.9 create successfully admin module but when I go to admin module I found IndexController.php renamed it to Admin_IndexController.php as you say
    another thing is in my .zfproject.xml I have :

    maybe help!

  7. Nick says:

    Hi Behrang,

    you should NOT rename the filename IndexController.php in the admin module, BUT rename the class name inside this file from class IndexController to class Admin_IndexController

    Admin_ is a namespace specifically used for classes INSIDE the admin module directory.

    Friendly greetings,
    Nick

  8. Behrang says:

    Dear Nick
    With your help my problem solved that wasted two days of my time .
    Tanks
    Behrang

Leave a Reply

Your email address will not be published. Required fields are marked *