Zend Framework Tutorial for ZF 1.10

Zend Framework 1.10, was released a week or so ago.

As a result, I have updated my Zend Framework tutorial so that it is completely current. The main change I made was to remove the _init methods in the Bootstrap as they are no longer needed. I also take advantage of the new features of the zf tool to enable layouts and create forms. It's a shame that it gets the class name of the form wrong though!

Screen short of Zend Framework tutorial

20 Responses to “Zend Framework Tutorial for ZF 1.10”

  1. 1 Chris

    Rob, your tutorial is excellent. I'm learning PHP from scratch, and your tutorial was the first that I'd done from start to finish.

  2. 2 Duc

    Thanks for the tutorial!

  3. 3 William

    Thanks for the great tutorial. I'm having a problem with the model section in the beginning, where you add Application_Model_DbTable_Albums in application/models/DbTable then use it in the controller.

    Warning: include_once(Application\Model\DbTable\Provider.php) [function.include-once]: failed to open stream: No such file or directory in C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library\Zend\Loader.php on line 146

    It looks like it is expecting the file to be in Application\Model\DbTable\ ?

    In the end I resolved the problem by adding:

    require_once '../application/models/DbTable/Provider.php';

    in the controller, but would be interested to know how I can avoid having to do this each time.

    Thanks :)

  4. 4 Dinesh

    hi,

    thank you for pulishing a grate tutorials for beginers like us. i just started to learn zend and i'm using windows xp.

    i set up all the tutorial and they're working nicely, but it couldn't connect to my database.it's mysql and i tryed to connect scrab db and user table.but when model try to get data it shows "An error occurred" and "Application error".

    please help me to solve this.

    thank you.
    Dinesh

  5. 5 farhadn

    http://mi-linux.wlv.ac.uk/~0810588/zend4/public/index/add

    http://mi-linux.wlv.ac.uk/~0810588/zend4/public/index/edit/id/7

    hi i keep getting these two error messages can anyone help me please

  6. 6 FWaweru

    Thanks for the excellent tutorial. Am new to zend framework and php and I have tried to view zf_tutorial project but am having the following error..

    Fatal error: Class 'Application_Model_DbTable_Albums' not found in F:\xampp\htdocs\leadone\application\controllers\IndexController.php on line 15
    please assist.

    Regards

  7. 7 greg606

    Why _init are not necessary anymore?

  8. 8 Shah Mubashir

    Hi,
    I am new to zend framework. I tired to set the zend tool. But it gave me an error.
    php.exe is not recognized as an internal or external command.
    My os is windows xp.
    I am using wamp server `i`.
    In the enviroment variable there was a another variable set which is working fine. But the zend tool is not. plz help if u can.

  9. 9 Paweł

    @Shah Mubashir
    This error message was a pain in the neck, but I found great tutorial about Zend Tool.
    Please check this link:
    http://www.armando.ws/2009/05/how-to-set-up-zend_tool-on-windows/comment-page-1/

  10. 10 nguyenloi85

    @ William , @FWaweru : please add appnamespace = "Application"
    in part [production] in file config , it's will be work fine!
    Good luck.

  11. 11 Rob...

    nguyenloi85,

    the zf command line tool in 1.10 should be putting that into application.ini when a project is created using zf create project, surely?

    Regards,

    Rob...

  12. 12 zf-beginner

    Thanks for your tutorial, it's really help me to begin zf 1.10.. This far far away better than documentation on ZF website.. ^^
    is there another zf tutorial after this? I really hope there is.
    Thanks.

  13. 13 adi

    Although I've done as instructed in terms of files set-up and added the ;C:\Program Files\ZendFrameworkCli\bin to the environment variable, when I try to issue zf commands at the windows command prompt, I get the message :

    '"php.exe" is not recognised as an internal or external command, operable program or batch file.

    I don't understand where the problem lies - any suggestions ?

  14. 14 Rob...

    Adi,

    You need to put the folder where php.exe is stored into your PATH environment variable too.

    Regards,

    Rob...

  15. 15 adi

    ow,,nice,,thanks Rob,,it's running :D

  16. 16 Jose

    After I update the IndexController and update the index.phtml file, I go to the site url and I get a completely blank page, even the source is blank. Up to that point, I had been seeing all the pages as shown in the demo. Any ideas?

  17. 17 Jose

    Nevermind, I had some backwards parens in the controller (duh).

  18. 18 mido

    thank you rob tutorial work fine

  19. 19 ken

    I am still getting this error:

    Fatal error: Class 'Application_Model_DbTable_Albums' not found in C:\Program Files\BitNami WAMPStack\apache2\htdocs\zend\zf-tutorial\application\controllers\IndexController.php on line 15

    even after I did what nguyenloi85 suggested.

    What is the problem?

    Ken.

  20. 20 Shah Mubashir

    @Ken

    Look in the folder C:\Program Files\BitNami WAMPStack\apache2\htdocs\zend\zf-tutorial\application\controllers\models\DbTables\Albums.php file exists.

    if it exists then see the declaration of the class. It should have to be like
    Application_Model_DbTable_Albums extends Zend_XXX

    if its not like the above declaration then make it like the above declaration.

    In zend framework a file is located like this foldername_foldername_foldername_filename without extension.
    As it is suggested above Application_Model_DbTable_Albums
    Regards,
    Shah Mubashir

The views expressed in these comments are not the views of the publisher. However, we believe in the rights of others to express their legitimate views and concerns. Any legitimate complaint emailed to rob@akrabat.com will be seriously considered and the post reviewed as desirable and necessary.