Tutorial: Getting Started with Zend Framework 1.8 and 1.9

Screen short of Zend Framework tutorial

This tutorial is intended to give an introduction to using Zend Framework to write a simple database driven application. It has been extensively rewritten for version 1.8 of the framework and takes full advantage of the Zend_Tool command line script and Zend_Application for bootstrapping. Other components used include Zend_Controller, Zend_View, Zend_Db_Table and Zend_Form.

This tutorial has been tested on versions 1.8 and 1.9 of Zend Framework. It will not work on any version prior to version 1.8.

If you are getting 404 errors when going to any page other than the home page, please make sure that you have set AllowOverride to All in your Apache configuration and have enabled the mod_rewrite extension.

If you are deploying to a "user" site (e.g. http://localhost/~rob), then you need a RewriteBase line in your .htaccess file that looks something like: RewriteBase /~rob/zf-tutorial/public/.

English version: Dowload the PDF (v1.6.4).

Code

The associated code is available:

Further reading

Once you have finished this tutorial, consider buying my book, Zend Framework in Action. Also, the Quick Start is worth reading.

Chris Kirk has kindly provided a Q&A PDF which may help if you are having problems.

Previous versions of this tutorial

The tutorial for Zend Framework 1.5, 1,6 and 1,7 is still available, along with the translations for it. You can also find original tutorial for Zend Framework 1.0.

Changelog

1.6.4 (20/Jan/2010)
Fixed more typos and errors. Thanks to many people who reported them.
1.6.3 (05/Aug/2009)
Fixed typos and tested with 1.9.0. Updated to note that 1.9 comes with its own BaseUrl view helper. Thanks to many people who reported the typos, including Spabby on Freenode IRC's #zftalk channel :)
1.6.2 (05/May/2009)
Code in deleteAction() now matches code in zip file! Thanks to Luis and Oleg Lobach.
1.6.1 (01/May/2009)
Minor fixes. Thanks to Tomas Fejfar and Luis.
1.6.0 (01/May/2009)
Completely updated and significant portions revised for Zend Framework 1.8

342 Responses to “Tutorial: Getting Started with Zend Framework 1.8 and 1.9”

  1. 1 Mario Bittencourt

    Hi,

    I've finished reading the tutorial. Easy to follow but still touching a lot of required and important areas of the ZF.

    Good stuff to get started!

  2. 2 Fábio T. da Costa

    Great article, I'm starting a new project and I'll use the ZF 1.8.

  3. 3 Wojciech Naruniec devBlog » Mamy przełom? Zend Framework 1.8.0

    [...] Najlepszą drogą do zapoznania się z nowymi narzędzami może być oficjalny przewodnik Zend Framework Quick Start, a także przewodnik Roba Allena. [...]

  4. 4 Wojciech Naruniec devBlog » Zend Framework 1.8.0 has been released

    [...] You can find out more about new RAD features reading Zend Framework Quick Start and Zend Framework Tutorial by Rob Allen. [...]

  5. 5 Oleg Lobach

    Thanks for great tutorial and operational changes for ZF1.8 release.

    But in delete action something strange - why you use $form variable and where it initialized?

  6. 6 Rob...

    Oleg,

    Fixed in version 1.6.2.

    Regards,

    Rob...

  7. 7 Zend Framework 1.8 erschienen | KingCrunchs kleine Welt

    [...] Akrabat hat auch schon sein Tutorial auf 1.8 angepasst. Author: KingCrunch Categories: PHP, Zend Framework Tags: Kommentare [...]

  8. 8 Joe Devon

    Nice tutorial, but one thing I'm not clear on is how to use my own configuration variables in the application.ini and access them?

    For example, in earlier ZF versions, I could put a custom setting in app.ini:
    cms.max.feeds = 10

    Then in the bootstrap:
    $configuration = new Zend_Config_Ini(
    APPLICATION_PATH . '/config/app.ini',
    APPLICATION_ENVIRONMENT
    );
    $registry = Zend_Registry::getInstance();
    $registry->configuration = $configuration;

    The in the controller this worked:
    $this->_nMaxFeeds = INTVAL(Zend_Registry::getInstance()
    ->configuration
    ->cms
    ->max
    ->feeds);

    but now I have no idea to get the same functionality in ZF 1.8.0.

    I tried following your tutorial, the Quickstart, reading the ZF docs and reading through a good chunk of the code and am stuck.

    Thanks.

  9. 9 Rob...

    Joe,

    In a controller method, you can do this:

    
    $bootstrap $this->getInvokeArg('bootstrap');
    $configArray $bootstrap->getOptions();
    
    

    If you want it as a Zend_Config object, then add this line:

    
    $config = new Zend_Config($configArray);
    
    

    Regards,

    Rob...

  10. 10 Joe Devon

    Aaah. Thank you so much!

  11. 11 Colleen Dick

    Am I just stupid or did I miss something. I set up the tool and tried to get the scaffolding to come up. it can't seem to include Application.php, and I know that is there.

    Failed opening required 'Zend/Application.php' (include_path='/var/www/zf-tut/library:.:/usr/share/php:/usr/share/pear' in /var/www/zf-tut/public/index.php on line 18

    but look:
    /var/www/zf-tut/library/Zend$ ls -al Application.php
    -rw-rw-r-- 1 colleen colleen 9232 2009-05-03 20:31 Application.php

  12. 12 Colleen Dick

    I got it to work by deepsixing the symlink to the Zend library and actually copying it. It would be nice to know why the symlink didn't work. It has always worked in my other ZF experiments.

  13. 13 Jacek

    Hi!

    While working with previous releases of ZF, I was always setting the baseUrl via FrontController:
    $frontController->setBaseUrl('/some/path');

    How to set this path now?

    Also, I am using .htaccess file to start my app, in root directory:
    RewriteRule .* public/index.php

    But using it now (I am not using VirtualHost to set the path to public dir) makes ZF display 'Page not found' error.

    How do I solve this?

    Regards,
    Jacek

  14. 14 Djaarf

    Again it is necessary to alter all :(. Thanks for your work!

  15. 15 Jacek

    OK - I've solved it :)
    I've just added a line of code in application.ini file:
    resources.frontController.baseUrl = "/some/path"

    Regards,
    Jacek

  16. 16 Colleen Dick

    Thanks it all works. Like the new auto tools, hope they include a default layout or option therefore, now must go read the help. :)

  17. 17 Colleen Dick

    OK now I am very confused how I adapt stuff written w/ earlier Zend to 1.8 For example, I have this line

    $frontController->registerPlugin(new Custom_Controller_Plugin_MemcachedSetup(),96);

    in an old bootstrap file in the runApp method. Where do I put it now? And are we still stuck with those stupid ordering numbers? Because I think they are kludgy.

  18. 18 Joe Devon

    Why is $bootstrap = $this->getInvokeArg('bootstrap');
    only available in a controller method?

    Config data is needed all over the place.

    I'm converting my code to 1.8.0 and for example need to access the config variables in a controller action helper, but it returns "Fatal error: Call to undefined method Zend_Controller_Action_Helper_MyHelper::getInvokeArg()"

  19. 19 Zend Framework and Microsoft IIS | Juozas devBlog

    [...] task today was to make Rob Allen's Zend framework tutorial project run on Windows. Some years ago such task could have been a problem, but as you will see, [...]

  20. 20 Rob...

    Joe,

    From a controller action, can't you just use $this->getController()->getInvokeArg('bootstrap') ?

    If you really need config everywhere, then you could do this:

    
    class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
    {
        public function run()
        {
            Zend_Registry::set('config', 
                new Zend_Config($this->getOptions()));
            parent::run();
        }
    }
    
    

    The config file will now be in the registry as a Zend_Config object.

    Regards,

    Rob...

  21. 21 Joe Devon

    Thanks Rob. I've rewritten my code to circumvent it but it's very useful being able to put it all in the registry just in case.

  22. 22 Zend Framework: Akrabat’s Quick Start Tutorial | eKini: Web Developer Blog

    [...] The PDF can be downloaded here directly. And you can find some notes from his blog post here. [...]

  23. 23 Konopnickiej.Com Blog » Została wydana wersja Zend Framework 1.8.0 Ponad 200 błędów poprawionych, kilka nowych komponentów oraz narzędzi

    [...] Zend Developer Blog. Zmianie uległy także Zend Framework QuickStart oraz świetny tutorial Roba Allana (Akra's DevNotes). Author: Paweł Wojciechowski Categories: Zend Framework Tags: Zend Framework Komentarze [...]

  24. 24 Colleen Dick

    I understand that stuff written with the old bootstrap way will work just fine but I want to convert a small project to the 1.8 way so I can LEARN what the correspondences are. All I've seen so far is small examples of the new way without much bootstrapping. Could we have a concise point by point comparison for example: how and WHERE do you register plugins & helpers first the old way then the new way. What do these _init* things correspond to if anything in the old way. I need EXACTLY everything spelled out. just giving me code snippets won't work because I will have no idea where it goes. I think I understand they can now be resources in some way and you put them in the config yes? ??? But I am just not putting together all the pieces. I have asked questions and people give me hand wavy answers as if I already should KNOW. But I don't KNOW and I want to learn but I can't learn if I just hear glib instructions like "oh just put it in the config." What exactly is "IT" and what does the config look like and then once I do that how and where do I use it! How I learn is pretty much strictly by example. I do not understand verbal explanations very well. Is there a new ZFiA with all this in it and can I download it?

  25. 25 Joe Devon

    Rob,

    "If you really need config everywhere, then you could do this:

    class Bootstrap extends Zend_Application_Bootstrap_Base
    {
    "

    I don't see that file and running it returns:

    "Fatal error: Class 'Zend_Application_Bootstrap_Base' not found in C:\joedevon\workspace\application\Bootstrap.php on line 2"

    ===
    In any event, where it's disturbing me is I'd like to write my own queries rather than rely on Zend_Db_Table.

    But since the getInvokeArg('bootstrap') is unavailable in the models, how are you supposed to use the vars that were brought into the Bootstrap from application.ini?

  26. 26 Rob...

    Doh,

    I meant Zend_Application_Bootstrap_Bootstrap rather. I've corrected the above example too.

    It rather depends on how your model depends on your database adapter. If you use Zend_Registry, then you could do:

    
    class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
    {
        public function _initDbAdapter()
        {
            $this->bootstrap('db');
            $dbAdapter $this->getResource('db');
            Zend_Registry::set('dbAdapter'$dbAdapter);
        }
    
        // any other _init methods
    }
    
    

    Regards,

    Rob...

  27. 27 Joe Devon

    Thank you thank you. It was making me crazy. That fixed my problems :) Hopefully I'll be good to go from here on out :)

  28. 28 Mark

    Colleen,

    If you need to register new plugins add the following lines to your bootstrap file. I know others will be looking for the same solution.

    // Create application, bootstrap, and run
    $application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
    );

    // ADD THESE 2 LINES
    $bootstrap = $application->getBootstrap();
    $bootstrap->registerPluginResource(new My_Plugin_Class());

    $application->bootstrap()
    ->run();

  29. 29 Madarco DevBlog » Blog Archive » Build a Facebook application with Zend Framework

    [...] set up an empty Zend Framework project: you can use the Zend Studio for Eclipse wizard or the new Zend_Tool command line. Use Zend Studio wizard to create an empty Zend Framewrok [...]

  30. 30 zig2na

    Im new to zend framework and I have been able to follow through with the tutorial but I get the following error at the end it:

    Message: No adapter found for Model_DbTable_Customers

    Stack trace:

    #0 E:\sites\metersys\library\Zend\Db\Table\Abstract.php(652): Zend_Db_Table_Abstract->_setupDatabaseAdapter()
    #1 E:\sites\metersys\library\Zend\Db\Table\Abstract.php(286): Zend_Db_Table_Abstract->_setup()
    #2 E:\sites\metersys\application\controllers\IndexController.php(17): Zend_Db_Table_Abstract->__construct()
    #3 E:\sites\metersys\library\Zend\Controller\Action.php(512): IndexController->indexAction()
    #4 E:\sites\metersys\library\Zend\Controller\Dispatcher\Standard.php(288): Zend_Controller_Action->dispatch('indexAction')
    #5 E:\sites\metersys\library\Zend\Controller\Front.php(936): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #6 E:\sites\metersys\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
    #7 E:\sites\metersys\library\Zend\Application.php(303): Zend_Application_Bootstrap_Bootstrap->run()
    #8 E:\sites\metersys\public\index.php(26): Zend_Application->run()
    #9 {main}

    Request Parameters:

    array(3) {
    ["controller"]=>
    string(5) "index"
    ["action"]=>
    string(5) "index"
    ["module"]=>
    string(7) "default"
    }

  31. 31 zig2na

    I am using zend server 4.0.1 with apache on vista and oracle.

    Thanks.

  32. 32 Ashley Broadley

    This is a fantastic tutorial. It gives you that extra bit of understanding compared to the Quickstart. Im very new to ZF and I am eager to learn more. I'm wondering if there will be another tutorial that makes use of authentication and some kind of administration module (i.e a blog?). You've done a great piece of work here though! Two thumbs up!

  33. 33 Rob...

    zig2na,

    What is in your config file?

    Regards,

    Rob...

  34. 34 zig2na

    Rob,

    Thanks for your quick response. Fortunately, I have been able to resolve it.
    I was using the following db strings:

    database.db.adapter = Pdo_Oci
    database.db.params.host = 192.168.1.10
    database.db.params.username = avrladmin
    database.db.params.password = nasa
    database.db.params.dbname = mavrl
    database.db.params.port = 1522

    instead of:

    resources.db.adapter = Pdo_Oci
    resources.db.params.host = 192.168.1.10
    resources.db.params.username = avrladmin
    resources.db.params.password = nasa
    resources.db.params.dbname = mavrl
    resources.db.params.port = 1522

    I copied it from one of my trials.

    Cheers!

  35. 35 Keith

    Has anyone figured out how to separate controllers within the Boostrapper in ZF 1.8?

    I have this in 1.7:

    $front = Zend_Controller_Front::getInstance();

    $front->setControllerDirectory(array(
    'admin' => '../application/admin/controllers',
    'default' => '../application/default/controllers'
    )
    );

    I know I can create an "AdminController" in my "top level" directory that contains all of the admin tools but that would get quite large with several actions.

    This way administrative tools can be kept separate from the public side of the site (in "default"). Has anyone solved this issue?

    Thanks in advance.

  36. 36 ramco

    Hi
    I have an error

    my ini file looks like

    resources.db.adapter = Pdo_Oci
    resources.db.params.host = localhost
    resources.db.params.username = dd
    resources.db.params.password = dd
    resources.db.params.dbname = xe

    My Albums
    An error occurred
    message ?>
    Exception information:

    Message: exception->getMessage() ?>
    Stack trace:

    exception->getTraceAsString() ?>

    Request Parameters:

    request->getParams()) ?>

  37. 37 zig2na

    Try this with oracle adapter and note the dbname line.

    resources.db.adapter = oracle
    resources.db.params.host = 127.0.0.1
    resources.db.params.dbname = 127.0.0.1/xe
    resources.db.params.username = crm
    resources.db.params.password = crm
    resources.db.params.port = 1521

  38. 38 Rob...

    Keith,

    I use a separate module for administration controllers.

    Regards,

    Rob...

  39. 39 GrapeApe

    Thanks for the great tutorial!

    Can the config.ini be used to specify multiple databases? My application uses 2 DBs and it doesn't appear the DB resource can handle multiple databases specified in the ini in any way shape or form.

    I know I can create a new "DBs" resource and have that handle an array of db resources, but is that the best practice?

  40. 40 racmo

    zig2na,
    thanks for your advice. I' ll try .
    If is the table in different schema. What is change in config.ini file?

  41. 41 zig2na

    racmo,
    XE uses your username to select schema provided all the other details given are correct and its able to talk to the XE listner.

  42. 42 ramco

    zig2na,
    actually apache connect to database I saw entris in the listener.log. But the error stil goes on.
    my other question is
    if table's owner different schema from my provided username, how can i select the table? thanks.
    best regards.

  43. 43 zig2na

    ramco,
    your username serves as your schema in XE. But you have to use 'localhost/xe' in your connect as the dbname instead of your actual username which doubles as the schema.

  44. 44 Cant load models - Zend Framework Forum

    [...] load models Hi there, I'm trying to follow the tutorial in Akra's DevNotes Tutorial: Getting Started with Zend Framework 1.8 but with little sucess! When I get to part that I need to add the code: public function [...]

  45. 45 ramco

    Hi, My problem is all identifier is in "" . oracle support uppercase identifier by default. So, how can implement CASE_FOLDING option in ini file to use db connection? is any suggestion. thanks.

  46. 46 Umair cheema

    Hi,
    It's really a nice tutorial. I am doing something wrong in setting up the path.
    I have successfully set a path and created a project using command
    zf create project xyz
    Now, i need to setup actions in controllers:
    According to tutorial i can do it by using command:
    zf create action add index
    but to do this i should be in xyz/application or xyz directory (not sure ). When i go in directory through command prompt and write the command it gives error that
    "PHP.exe is not recognized as internal or external command"
    And definitely it is correct because php.exe is in c:\php folder instead of c:\php\xyz folder

    Can anybody tell me how can i set actions in C:\php\beta\application\controllers\IndexControlle r.php
    I will really be very thankful to you.
    Regards,
    Umair

  47. 47 Breen Liblong

    Hi Rob,

    Very nice tutorial! I'll definitely checkout your book.

    FYI, the latest version of the pdf (v1.6.2) is missing a section at the top of page 6.

    The previous version of the pdf (v1.5.2) had the following segment (before the sentence fragment) at the top of page 6:

    By default, Zend Framework’s controller reserves a special action called index as a default
    action. That is, for a URL such as http://localhost/zf-tutorial/public/news/
    the index action within the news controller will be executed. There is also a default controller
    name should none be supplied. It should come as no surprise

  48. 48 zig2na

    ramco,

    Try this:

    resources.params.options.caseFolding = caselower

  49. 49 Luciano

    hello,
    Great tutotrial! It all works and the explanations are very good.
    My only question is why did you get the view from the layout:

    $this->bootstrap('layout');
    $layout = $this->getResource('layout');
    $view = $layout->getView();

    as directly getting the view as they show on the zends quick start guide?

    $this->bootstrap('view');
    $view = $this->getResource('view');

    Does it have some benefit?
    thanks!
    Luciano

  50. 50 sims

    Thanks Rob for the tutorial and answers and everyone for your comments. I learned a lot just reading the comments section. I didn't even know ZF has changed since 1.8. I like to use best practices when coding. So it was confusing to see all the differing examples and ways of doing things. Now off to read more.

    Cheers!

  51. 51 Rob...

    Luciano,

    In my tutorial, I don't create a view resource within the bootstrap class or application.ini file.

    Given that you can collect the view from the layout, and I needed to bootstrap the layout anyway, it made sense to grab the view that way.

    Regards,

    Rob...

  52. 52 Pablo

    Hi Rob and thanks for the tutorial.

    I'm having a problem, just added the actions for the IndexController.php via terminal console fine, but when I try to test the URL of the action.. example:

    http://localhost/zf-tutorial/public/index/edit

    I'm getting a 404 Error from Apache, I've been trying to figure out what's going on but I couldn't, a little of help would be appreciated :)

    Thanks in advance!

  53. 53 Pablo

    Ok it's solved

    I just forgot to add AllowOverride All in the httpd.conf for the directory of my project, all is working fine now :-)

  54. 54 ramco

    Zigna,
    thanks for your advice.
    I used this params

    db.params.options.autoQuoteIdentifiers = 0

    It solves one of my problem. But this case, ID column is must be uppercase (ID). But in the sample code the identifier written by lowercase (id), I tried your advice but column identifiers still return with uppercase.

  55. 55 Mohamad A

    I am newbie to Zend framework, while trying your code i got the below error, please guide

    Fatal error: Class 'Models_DbTable_Albums' not found in /var/www/zend_site/application/controllers/IndexController.php on line

  56. 56 khem raj

    Thanks Rob for the tutorial and answers and everyone's comments.But I want to know how We can run Project with "http://localhost/myname" without typing public folder.

  57. 57 Petar

    Hi Rob, guys,
    I am kind of new to ZF, but keen to learn it. So i grabbed the tutorial and ZF 1.8.1 and tried the tutorial both on Win and Ubuntu servers. So I have to say I had very strange and frustrating initial results. On windows i had no bootstrap.php(lower case) file at all and noting in index.php but require_once "bootstrap.php", and as nothing in the tutorial mentioned that something should be done about that I assumed it is ok. It wasn't. Anyway downloading the code and comparing to what I have I understood that I am way off. By pasting the missing bootstrap content everything came to place. On contrary on Ubuntu Zend_Tool created a lot of bootstraping and a default module, all different again from what is used in the tutorial. I am sure that with some adaptation the tutorial will work just fine with the default configuration from Zend_Tool but for a newbie like me it is quite a struggle to get up and running without a clue that something should be changed in the default settings. Other then that it is a great introduction to ZF, and I will probably by the second edition of ZFiA since I heard that there are some errors there too still.

  58. 58 Petar

    Edit to my previous comment - it seems that the problem is not in Zend_Tool, but zend studio which i desided to use for the tutorial, when you make a zf project in zs it overwrites a lot of stuff in your project structure.

  59. 59 Ashley Broadley

    Petar,

    You would need to setup a virtual host within apache (don't know if you are using apache). Search online. there are plenty of good resources for it.

  60. 60 Ashley Broadley

    sorry previous post was meant for khem raj not Petar.

  61. 61 KhemRaj

    Hi,
    I want to solve this problem without using Virtual Host Please Help me.

  62. 62 Rob...

    KhemRaj,

    Place your index.php file in the root directory and modify paths appropriately.

    Regards,

    Rob...

  63. 63 Oleg Lobach

    Hi Rob,
    I found a syntax error - bottom of page 3, DocumentRoot must be '/var/www/html/zf-tutorial/public', but in manual '/var/www/html/z-ftutorial/public'

    With best regards...

  64. 64 Rob...

    Thanks Oleg :)

    Rob...

  65. 65 khem Raj

    hi,
    Thanks for reply Please tell me how we can set the appropriate path after placing index.php in root please explian in detail.
    Thanks.

  66. 66 Jim

    Hey,

    I'm trying to do your tutorial 'Getting started with Zend Framework' Document Revision 1.6.2 and I've come to page 13 of 17. When trying to view the index page I'm getting the following error:

    Notice: Undefined variable: moduleLoader in /Applications/MAMP/htdocs/zf-tutorial/application/Bootstrap.php on line 10

    Fatal error: Uncaught exception 'Zend_Controller_Response_Exception' with message 'Cannot send headers; headers already sent in /Applications/MAMP/htdocs/zf-tutorial/application/Bootstrap.php, line 10' in /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Controller/Response/Abstract.php:281 Stack trace: #0 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Controller/Response/Abstract.php(299): Zend_Controller_Response_Abstract->canSendHeaders(true) #1 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Controller/Response/Abstract.php(727): Zend_Controller_Response_Abstract->sendHeaders() #2 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Controller/Front.php(974): Zend_Controller_Response_Abstract->sendResponse() #3 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Application/Bootstrap/Bootstrap.php(77): Zend_Controller_Front->dispatch() #4 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Application.php(328): Zend_Application_Bootstrap_Bootstrap->run() #5 /Applications/MAMP/htdocs/zf-tutorial/public/index.php(26 in /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Controller/Response/Abstract.php on line 281

    I'm running a MAMP server on Mac OS X.

    Can anyone help me? Thanks!

  67. 67 Jim

    Hey,

    now I'm having another problem.
    Whem I'm trying to view http://localhost:8888/zf-tutorial/public/

    of my MAMP on Mac OS installation
    it says:

    Add new album
    An error occurred
    Application error
    Exception information:

    Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zf.Model_DbTable_Albums' doesn't exist
    Stack trace:

    #0 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
    #1 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Db/Adapter/Abstract.php(467): Zend_Db_Statement->execute(Array)
    #2 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Db/Adapter/Pdo/Abstract.php(235): Zend_Db_Adapter_Abstract->query('DESCRIBE `Model...', Array)
    #3 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Db/Adapter/Pdo/Mysql.php(156): Zend_Db_Adapter_Pdo_Abstract->query('DESCRIBE `Model...')
    #4 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Db/Table/Abstract.php(727): Zend_Db_Adapter_Pdo_Mysql->describeTable('Model_DbTable_A...', NULL)
    #5 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Db/Table/Abstract.php(770): Zend_Db_Table_Abstract->_setupMetadata()
    #6 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Db/Table/Abstract.php(923): Zend_Db_Table_Abstract->_setupPrimaryKey()
    #7 /Applications/MAMP/htdocs/zf-tutorial/application/models/DbTable/Albums.php(24): Zend_Db_Table_Abstract->insert(Array)
    #8 /Applications/MAMP/htdocs/zf-tutorial/application/controllers/IndexController.php(33): Model_DbTable_Albums->addAlbum('The Killers', 'Day and Age')
    #9 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Controller/Action.php(512): IndexController->addAction()
    #10 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Controller/Dispatcher/Standard.php(288): Zend_Controller_Action->dispatch('addAction')
    #11 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Controller/Front.php(936): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #12 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Application/Bootstrap/Bootstrap.php(77): Zend_Controller_Front->dispatch()
    #13 /Applications/MAMP/htdocs/zf-tutorial/library/Zend/Application.php(328): Zend_Application_Bootstrap_Bootstrap->run()
    #14 /Applications/MAMP/htdocs/zf-tutorial/public/index.php(26): Zend_Application->run()
    #15 {main}

    Request Parameters:

    array(7) {
    ["controller"]=>
    string(5) "index"
    ["action"]=>
    string(3) "add"
    ["module"]=>
    string(7) "default"
    ["id"]=>
    string(0) ""
    ["artist"]=>
    string(11) "The Killers"
    ["title"]=>
    string(11) "Day and Age"
    ["submit"]=>
    string(3) "Add"
    }

    databasename is: zf
    tablename is: albums
    I'm using default username/password: root

    can anyone help me? Thanks!

  68. 68 Jim

    It looks like it's working now. I've removed a "?>" at the end of Albums.php
    Thanks anyway.

  69. 69 T3ch

    I followed the tutorial and everything works correctly, but When I modify your 4 record, I see:
    It\'s Not Me, It\'s You
    and not:
    It's Not Me, It's You

    There is a problem with quote...

  70. 70 Rob...

    T3ch,

    Turn off magic_quotes_gpc

    Regards,

    Rob...

  71. 71 T3ch

    Thank's Rob. Your tutorial and your site are very usefully.

  72. 72 Erich

    Rob,

    Great tutorial!

    I was running some memory tests on this application, and I noticed that most pages use about 7 MB of memory for each script. I was using memory_get_peak_usage(). Isn't that a bit high for a web app such as this? I am new to ZF, so I may have no clue what I am talking about.

    Thanks, Erich

  73. 73 Marco

    Hey. I'm having some trouble running zf.sh. It leaves me with the following notification:

    /usr/local/ZendFrameworkCli/bin/zf.sh: 44: php: not found

    Any advice on how to solve this?

  74. 74 Erich

    Marco,

    I had the same issue. To fix it, run phpinfo() and check to make sure that your "include_path" is pointing to the correct directory. Make sure the "Zend" folder from the zend framework download is in that folder as well. That took care of the issue for me.

  75. 75 Marco

    Erich, thank you for your help. I havent been able to fix it on my localhost however. So I decided to put it on my 1and1 hosting space. That however leaves me with another error:

    (uiserver):u47756847:~/ZendFramework-1.8.2/bin > zf.sh show version

    Parse error: syntax error, unexpected T_STRING, expecting '{' in /path_to_my_hosting_directory/ZendFramework-1.8.2/library/Zend/Tool/Framework/Client/Console.php on line 63

    I'm quite sure this is due to an older php version (4.*), since the line being mentioned (63) contains 'implements' (which is php 5 only).

    1And1 does support php5 by using a htaccess file. So I tried creating a .htaccess file (AddType x-mapp-php5 .php) and it works fine when visiting pages through my browser. However when running the .sh file through SSH it still gives the error message. Any other solutions?

    Thanks in advance!

  76. 76 T3ch

    @Marco
    you must write to 1and1 and not here. Who manages the server can respond to your request

  77. 77 Erich

    I agree with T3ch. There a lot of additional variables that come into play, especially with shared hosting. Honestly, Zend Tool is nice for some of the busy work at the start of the project, but if you're just starting to learn ZF, you can just download the tutorial and start playing with it.

  78. 78 Colandy

    Have an issue, don't think this is unique to your tutorial as I get same on Quickstart tutorial. My setup is:

    Vista
    Apache - 2.2.11
    PHP - 5.2.9-2
    MySQL - 5.1.3

    The error is as follows:

    My Albums
    An error occurred
    message ?>
    Exception information:
    Message: exception->getMessage() ?>

    Stack trace:
    exception->getTraceAsString() ?>
    Request Parameters:
    request->getParams()) ?>

    Any Idea's ?!??

  79. 79 eben

    very helpful stuff.
    i use module but i can't seem to get the autoloader to work. some pointers would be helpful.

  80. 80 Buck

    Hello

    Tutorial is great, but i have still problem with adding new modules into tutorial code.

    Is there anyone who could public tutorial code extended about (for example) two simple modules?

    I'm searching web about it but there is no better tutorial than your's Rob but you give us only default module without IDEA of extending tutorial code for new modules.

    Please help me (and many zf users) with some advice.

  81. 81 khemRaj

    Hi,
    When I am placing index.php in root directory Then find folowing error.
    Fatal error: Uncaught exception 'Zend_Config_Exception' with message 'parse_ini_file(D:\xampp\htdocs\zf1.8application\configs\application.ini) [function.parse-ini-file]: failed to open stream: No such file or directory' in D:\xampp\htdocs\zf1.8\library\Zend\Config\Ini.php:184 Stack trace: #0 D:\xampp\htdocs\zf1.8\library\Zend\Config\Ini.php(125): Zend_Config_Ini->_loadIniFile('D:\xampp\htdocs...') #1 D:\xampp\htdocs\zf1.8\library\Zend\Application.php(320): Zend_Config_Ini->__construct('D:\xampp\htdocs...', 'development') #2 D:\xampp\htdocs\zf1.8\library\Zend\Application.php(78): Zend_Application->_loadConfig('D:\xampp\htdocs...') #3 D:\xampp\htdocs\zf1.8\index.php(18): Zend_Application->__construct('development', 'D:\xampp\htdocs...') #4 {main} thrown in D:\xampp\htdocs\zf1.8\library\Zend\Config\Ini.php on line 184

    Thanks.

  82. 82 Basic Database + zend framework « Zframework’s Blog

    [...] click here OR [...]

  83. 83 Joe Devon

    Rob,

    I see you're using public function() in the Bootstrap, but the quickstart makes them protected. Was there a particular reason to make them public?

    Thanks.

  84. 84 Marcus

    Great tutorial! Helped me a lot!!!

    I really had problems finding a tutorial to get started with Zend. Maybe they should offer more tutorials like this - the official Zend quickstart tutorial doesn't really help at all...

    So thanks for this. Looking forward to an updated version of your Zend_Auth tutorial ;-)

  85. 85 Rob...

    Marcus,

    They should be protected.

    Regards,

    Rob...

  86. 86 Joe Devon

    I think you meant me, but thanks Rob ;)

  87. 87 Joe Devon

    Sorry, I have another question. In your model, you are extending Zend_Db_Table rather than Zend_Db_Table_Abstract as the manual and quickstart instructions. When are you supposed to use the former and when the latter?

  88. 88 Rob...

    Joe,

    Zend_Db_Table_Abstract is better choice. I'll update the tutorial.

    Regards,

    Rob...

  89. 89 Sebastian Mantilla

    It seems to me as if in the PDF there are some lines missing.

    Look for example at the beginning of page 6, the first phrase is incomplete it is missing something at the beginning.

    Thanks for the tutorial.

  90. 90 Rob...

    Sebastian,

    Yeah there is :( I'll roll up a new one soon.

    Rob...

  91. 91 Joe Devon

    Rob & anyone still reading this far into the comments :)

    I just wanted to mention that I stopped using the registry to hold the dbAdapter. It turns out if you add this line to your application.ini file (if you only connect to one database as most probably do):

    resources.db.isDefaultTableAdapter = true

    then in your model you can just do:
    $this->_dbAdapter = Zend_Db_Table::getDefaultAdapter();
    and remove the whole section in the bootstrap that initializes your dbAdapter and puts it in the registry.

  92. 92 Michael B.

    This is the best tutorial which i could found on the web!

    Maybe someone can help me. I got

    Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Resource matching "layout" not found'

    after completing 12 page of tutorial.
    Im relatively new to PHP, and no wonder, to ZF...

  93. 93 Joe Devon

    Michael,

    I agree. Rob's book and online tutorials are a Godsend.

    Try adding these lines to your application.ini:

    resources.layout.layout = "layout"
    resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
    resources.view[] =

  94. 94 Dodo : Introduction | ThreadAffinity

    [...] Framework (ZF from here on). For those just starting out with ZF, you definitely want to check out Rob Allen's tutorials and blog posts if you haven't already. Rob's examples are some of the best out there [...]

  95. 95 Michael B.

    Thanks, Joe!
    Now I have a new errors %)
    After fixing some of them I stuck with another one:
    Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'BaseUrl'

    I have checked my files but without success. They all seems identical to what I can see in tutorial. I know that I made a mistake, but just doesnt see them

  96. 96 Michael B.

    Oh, I made a wrong cut. The full text:

    Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'BaseUrl' was not found in the registry

  97. 97 David

    Hello, Rob, you doing a great job, helping others to understand what is ZF is =)
    I want to do a translate of your "Tutorial: Getting Started with Zend Framework 1.8" and place it on this page. Is it real? do you need this?
    mail me please if you are interesting with it.
    p.s.
    mailto: enleonkiller (on) google mail.

  98. 98 David

    oh sorry, my fault.
    p.p.s. i want to translate it into russian.

  99. 99 Rob...

    David,

    I'd love it if you do a translation! Give it a few days though until I upload the next one with some typo fixes in it.

    Feel free to send it to me in PDF and I'll host it.

    Rob...

  100. 100 Joe Devon

    Hi Michael,

    Hmmm, I have no idea what that error means. Hopefully Rob will figure it out or another guru will see it & comment.

  101. 101 Scott Biggart

    Ramco,

    I too wanted to have the CASE_FOLDING attribute set in the application.ini file, this is what worked:

    resources.db.params.options.caseFolding = 2

    where 'caseFolding' is the value once the Zend_Db::CASE_FOLDING constant is evaluated and the int 2 is the value once the Zend_Db::CASE_LOWER constant is evaluated

    for reference, CASE_UPPER = 1

  102. 102 Jim

    Hi,

    I've tried your tutorial and it's works fine. Now I'm curios how I could read the record from the database in reverse order. So if I add a album, I want it to show up on top instead of at the bottom of the tabel.

    How can this be done?

  103. 103 Nils Becker

    Hi Rob,

    great tutorial - helped me a lot.

    One thing that doesn't work in my test.

    In my layout.phtml file the title is not displayed:
    escape($album->title); ?>
    The headTitle is displayed correct.

    Any ideas whaht i've made wrong?

    Thanks,
    Nils

  104. 104 Nils Becker

    Sorry the line of code in my post is wrong. The correct line is on page 10 the line in the h1 tag.

  105. 105 Alex Tech Adventures || Zend Framework MVC basics

    [...] The code you are looking at is taken from Akra's DevNotes blog, Getting started with Zend Framework tutorial. [...]

  106. 106 Andrey

    Thank you Rob for this tutorial!
    I feel like i'm lost something.. i need to get request parameters in the bootstrap (like controller name and action name), but Zend_Controller_Request_Http::getModuleName, etc. is empty...

    Can you please help?

    Thank you!
    Andrey

  107. 107 Dodo : Part 1 - Application Design | ThreadAffinity

    [...] the Dodo Introduction post, I recommended staring with Rob Allen's tutorial and the QuickStart guide for those just starting out because they do a better job of going [...]

  108. 108 Kalpesh

    Hi, Rob thanks for your tutorial
    Its Great.
    but i have problem with url having http://localhost/ZEND1.8/public/index/add.
    It is getting me 404 error.
    I also set the AllowOverride none in my httpd.conf file which is as follow :

    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

    can you help me ?

  109. 109 Dana Elza

    Hello,

    This is THE best tutorial for getting started with ZF. I understood what ws written, and the code worked, no problems at all.

    Now do a Navigation tutorial.

    5 years writing php and always something new to explore.

    Thanks!

  110. 110 Guelmis

    Hi:
    I'm kind of new using Zend, and I found a tutorial but I couldn't make my application work properly, it launches errors constantly, could anyone give me a link or anything so I can find an example that works with Zend 1.8 and has all the initial configuration of the application.ini, the .htacces and the boostrap.php???????
    It's really important.

  111. 111 Dave Poon

    Your tutorial is so good, easy to follow and understand, I have read many tutorials on the Internet, but the way of writing is so complicated, thank you so much.
    BTW, I just bought your book, just read a few chapters, I love it, thanks.

  112. 112 Fabio Rehm

    really nice tutorial!
    thanks for doing it.

  113. 113 hex

    great tutorial, very well written.thank you very much

  114. 114 Miriam

    Hi!

    I'm very new in ZendFramework and I have this problem I dont know what should configure for work with Zend_Db_Table_Abstract because if I create my class in this way :

    class Clientes extends Zend_Db_Table_Abstract and in my controller I create an object
    $Clientes = new Clientes();

    when I try my application the output is
    Fatal error: Class 'Clientes' not found in /home/miriam/zend_proyects/new_zend/application/controllers/IndexController.php on line 21

    and the line 21 is where I instance the object.

    What should I add for get it work.

    My boostrap file is this:

    '',
    'basePath'=> APPLICATION_PATH));
    return $moduleLoader;

    }

    function _initViewHelpers()
    {
    $this->bootstrap('layout');
    $layout = $this->getResource('layout');
    $view = $layout->getView();

    $view->doctype('XHTML1_STRICT');
    $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
    $view->headTitle()->setSeparator(' - ');
    $view->headTitle('Zend Framework Tutorial');
    }

    and my index.php is this

    bootstrap()
    ->run();

    Thanks in advance.

  115. 115 lj

    Is there a tool/application in ZF where I can supply a database (using oracle here) and the tool is will generate basic MVC files? even just the model + DAO objects?

    thank you :)

  116. 116 sriraj

    Hello rob ,

    I have down loaded the zip file and kept in the folder called zf .Now i am getting this error and i am using wamp server there i created an alias and placed the zf folder in the wamp of htdocs folder.after excuting in the browser as http://localhost/zf/public iam getting this error

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    so please clarify this .

  117. 117 Paul

    Just downloaded this tutorial and was hoping to check it out. However, when I type in "zf show version" in the command line, I get the following error:

    Parse error: parse error, expecting `'{'' in /usr/local/ZendFrameworkCli/library/Zend/Tool/Framework/Client/Console.php on line 63

    Is this just my installation?

    Thanks,
    Paul

  118. 118 Rob...

    Paul,

    I would re-download and try again.

    Rob...

  119. 119 Rob...

    sriraj,

    You probably haven't installed mod-rewrite, however if you look in your Apache error log, it will tell you the problem.

    Regards,

    Rob...

  120. 120 Paul

    Rob,

    Thanks for the reply. I re-download and installed but get the same error:

    Parse error: parse error, expecting `'{'' in /usr/local/ZendFrameworkCli/library/Zend/Tool/Framework/Client/Console.php on line 63

    Must be my Mac as I don't see that anyone else has a problem.

    Thanks,
    Paul

  121. 121 Rob...

    Paul,

    Which version of PHP are you using?

    Rob...

  122. 122 Paul

    Rob,

    I am using 5.2.4

    I actually get the same error message on my Mac at home that I am getting on the work Mac.

  123. 123 Janab

    hi Rob,

    Thanks for you fine tutorial.
    I follow your tutorial to setup zend framework. But I found the following error;

    Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'BaseUrl' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/;./views\helpers/;C:/wamp/www/zf-tutorial/application/views\helpers/' in C:\wamp\www\zf-tutorial\library\Zend\Loader\PluginLoader.php:397 Stack trace: #0 C:\wamp\www\zf-tutorial\library\Zend\View\Abstract.php(1117): Zend_Loader_PluginLoader->load('BaseUrl') #1 C:\wamp\www\zf-tutorial\library\Zend\View\Abstract.php(568): Zend_View_Abstract->_getPlugin('helper', 'baseUrl') #2 C:\wamp\www\zf-tutorial\library\Zend\View\Abstract.php(335): Zend_View_Abstract->getHelper('baseUrl') #3 [internal function]: Zend_View_Abstract->__call('baseUrl', Array) #4 C:\wamp\www\zf-tutorial\application\views\layouts\layout.phtml(6): Zend_View->baseUrl() #5 C:\wamp\www\zf-tutorial\library\Zend\View.php(107): include('C:\wamp\www\zf-...') #6 C:\wamp\www\zf-tutorial\library\Zend\View\Abstract.php(832): Zend_View->_run('C:\wamp\www\zf-...') #7 C:\wamp\www\zf-tutori in C:\wamp\www\zf-tutorial\library\Zend\Loader\PluginLoader.php on line 397

    If i remove $this->baseUrl() from the layout my application work fine. Please help me to get rid of this error.

    Regards,
    Janab

  124. 124 Rob...

    Paul,

    I'm stumped. Have you looked at the file? UTF-8/character encoding issue? line endings?

    Rob...

  125. 125 Rob...

    Janab,

    You either haven't created the BaseUrl view helperor you haven't put it in the right place/written the _initAutoload() function in your bootstrap class.

    Regards,

    Rob...

  126. 126 sriraj

    Hello Rob,

    Can u tell me how to install mod_rewrite and where should i place that.I would like to develop small employee details application,can u help me out.so that i can understand the flow .Because I am new to php and zend.

    Thanks,
    sriraj

  127. 127 sriraj

    Rob,

    I enabled the mod_rewrite in server config file but still getting same error as given in post 117,dont know where i am getting wrong.Clarify this error and also as mentioned in 127 please help me out to develop a small employee details application.

    Thanks,
    sriraj

  128. 128 Rob...

    sriraj,

    Read your error log and it will tell you what issue Apache is having.

    Rob...

  129. 129 Alan

    Rob I received the same error as Janab. I get the following error.

    Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'BaseUrl' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/;./views\helpers/' in D:\WEBSERVER\xampp\htdocs\PHP\ZEND\library\Zend\Loader\PluginLoader.php:397
    Stack trace:
    #0 D:\WEBSERVER\xampp\htdocs\PHP\ZEND\library\Zend\View\Abstract.php(1117): Zend_Loader_PluginLoader->load('BaseUrl')
    #1 D:\WEBSERVER\xampp\htdocs\PHP\ZEND\library\Zend\View\Abstract.php(568): Zend_View_Abstract->_getPlugin('helper', 'baseUrl')
    #2 D:\WEBSERVER\xampp\htdocs\PHP\ZEND\library\Zend\View\Abstract.php(335): Zend_View_Abstract->getHelper('baseUrl')
    #3 [internal function]: Zend_View_Abstract->__call('baseUrl', Array)
    #4 D:\WEBSERVER\xampp\htdocs\PHP\ZEND\application\layouts\scripts\layout.phtml(7): Zend_View->baseUrl()
    #5 D:\WEBSERVER\xampp\htdocs\PHP\ZEND\library\Zend\View.php(107): include('D:\WEBSERVER\xa...')
    #6 D:\WEBSERVER\xampp\htdocs\PHP\ZEND\library\Zend\View\Abstract.php(832): Zend_View->_run('D:\WEBSERVER\xa.. in D:\WEBSERVER\xampp\htdocs\PHP\ZEND\library\Zend\Loader\PluginLoader.php on line 397

    I have the BaseUrl.php in /application/views/helpers/BaseUrl.php. My bootstrap is as follows:

    class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
    {
    protected function _initAutoload()
    {
    $moduleLoader = new Zend_Application_Module_Autoloader(array(
    'namespace' => '',
    'basePath' => APPLICATION_PATH));
    return $moduleLoader;
    }
    protected function _initViewHelpers() // was _initDoctype
    {

    // initialize layout resource
    $this->bootstrap('layout');
    // retrieve Zend_Layout object
    $layout = $this->getResource('layout');
    // retrieve view
    $view = $layout->getView();
    // Set our global doctype
    $view->doctype('XHTML1_STRICT');
    $view->headMeta()->appendHttpEquiv('Content-Type','text/html;charset=utf-8');
    $view->headTitle()->setSeparator(' :: ');
    $view->headTitle('Test Website');
    }
    }

    In my layout.phtml file I am calling baseUrl as follows:

    headLink()->prependStylesheet($this->baseUrl().'/styles/test.css'); ?>

    Any ideas?

  130. 130 sriraj

    Rob

    I am getting this error in error log .

    D:/wamp/bin/apache/Apache2.2.11/htdocs/zf/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

    what should be the problem , iam not getting .

    sriraj

  131. 131 Rob...

    sriraj,

    Turn on the mod_rewrite module in your Apache configuration.

    Regards,

    Rob...

  132. 132 Coming Late to the Framework Party | Made of Everything You're Not

    [...] painful on Windows, but as long as you avoid the tutorial from Zend, and follow this one from Akra's Devnotes, you'll be [...]

  133. 133 lj

    a reply to my previous comment would be most appreciated :)

    thank you very much

  134. 134 Erich

    lj,

    Zend Tool will generate the basic MVC files, folders, etc. I am not sure what it can do for you as far as databases go, but the interface will be the same for all databases, just specify the database adapter in your INI file and you should be good to go.

  135. 135 rakesh

    Hi Rob,
    Thanks for providing this nice tutorial for novice like me.
    But I have two confusions: a. one in model you have shown extending Zend_db_table (this will fine as the example has one table). But in case of multiple tables interaction in that scenario how should i create my module?
    second confusion: uses of helper classes ?

    --rakesh

  136. 136 sw

    Hi Rob,
    I would like to appreciate your tutorial. I found a typo there (v. 1.6.2), in the pdf, page 9 in code:
    ---
    resources.layout.layoutpath = APPLICATION_PATH "/layouts"
    ---
    Missing concatenation. This could be confusing for beginners or newbies who just copy and paste code extracts in order to follow the tutorial.

    Best regards,
    sw

  137. 137 Dan

    great, up-to-date tutorial. Thanks.

  138. 138 sw

    oh. I didn't noticed it is a part of .ini file. Sorry

  139. 139 Rob...

    sw,

    As you have noted already, INI files are not PHP files :)

    Regards,

    Rob...

  140. 140 rolly

    I would like to use firebird database adapter, but I see that this is only supported on the extensions as I do to make it usable in the same manner as other adapters (mysql, sqlite, etc ...)?

  141. 141 Rob...

    rolly,

    You'll have to roll your own adapter and supporting classes.

    Regards,

    Rob...

  142. 142 rolly

    Thank you very much, I was supposed to use some form of simple extensions already created, like "ZendX" in some ways it is a shame I wanted to use the amenities of the new Zend 1.8.x, eg. application.ini to configure Firebird as database adapter. The truth is that I am too new at this and if I'm not asking correctly.

    Again thank you very much.
    P.D: Excuse my English translator.

  143. 143 dsantamaria

    i have a little issue

    after i try to login and failed i get redirected to the login form (thats perfect) but the username field that i filled when auth failed is cleared, its kidna annoying to type again the username when only ur password failed, is there anyway to "autoset" the value of the username field with the previous value it had before i pressed "submit"?

    dunno if i made myself clear, my english fail me sometimes

  144. 144 Hari K T

    Yes, pretty simple and nice one . I hope the book also covers much more examples like this.
    Will let you know after getting a copy of it . Also hope you have updated the book to include the 1.8 features. Also the 1.9 is available .
    Anyway Thanks for the wonderful one.
    I know a Thanks will not feed you . But buying a book may help you.

    Bye
    Hari K T

  145. 145 Hari K T

    Not a big deal . But a closing for the is missing in delete.phtml in pdf doc.

  146. 146 antonello

    Hi, i have this problem.

    Message: No adapter found for Model_DbTable_Lang

    Stack trace:
    #0 D:\xampp\htdocs\sw_v1\library\Zend\Db\Table\Abstract.php(652): Zend_Db_Table_Abstract->_setupDatabaseAdapter()
    #1 D:\xampp\htdocs\sw_v1\library\Zend\Db\Table\Abstract.php(286): Zend_Db_Table_Abstract->_setup()
    #2 D:\xampp\htdocs\sw_v1\application\controllers\IndexController.php(16): Zend_Db_Table_Abstract->__construct()
    #3 D:\xampp\htdocs\sw_v1\library\Zend\Controller\Action.php(512): IndexController->indexAction()
    #4 D:\xampp\htdocs\sw_v1\library\Zend\Controller\Dispatcher\Standard.php(288): Zend_Controller_Action->dispatch('indexAction')
    #5 D:\xampp\htdocs\sw_v1\library\Zend\Controller\Front.php(945): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #6 D:\xampp\htdocs\sw_v1\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
    #7 D:\xampp\htdocs\sw_v1\library\Zend\Application.php(328): Zend_Application_Bootstrap_Bootstrap->run()
    #8 D:\xampp\htdocs\sw_v1\public\index.php(26): Zend_Application->run()
    #9 {main}

    i use mysql, and i didn't understand why it's not work.

    Thanks

  147. 147 antonello

    this is my application.ini

    resources.db.adapter = Pdo_Mysql
    resources.db.params.host = localhost
    resources.db.params.username = root
    resources.db.params.password =
    resources.db.params.dbname = cms

  148. 148 ronny stalker

    Hi Rob,
    Thanks for these tutorials. Lifesaver.

    Is there a typo on your tutorial on page 11..

    I suspect the following line should be altered :

    (just above the code example for zf-tutorial/application/views/helpers/BaseUrl.php)

    Praps Change:
    "it must
    be called Zend_Controller_Helper_{HelperName}"

    to:

    "it must
    be called Zend_View_Helper_{HelperName}"

    ---
    Please feel free to delete this comment once typo is fixed (or just do it on a whim whenver you fancy ...i guess)

  149. 149 Jb

    If anyone is having the problem with the baseurl plugin error, i think i may have found the culprit. You get the error if you had followed the suggestion of a previous comment by Joe Devon of adding the following to your application.ini:

    resources.view[] =

    This line is unneeded, and will cause you to get the baseurl plugin error.

  150. 150 Jb

    Hi Rob,
    Thanks so much for the tutorial. Just a little note, the closing form tag is missing in the delete.phtml section on page 17 of the tutorial

  151. 151 Erdal

    Hi Rob

    I updating my high school alumni association web site with ZF 1.8. I downloaded ZF 1.8.4 minimal and setup all necessary paths and etc.

    But when I run zf create project bvt.gbhlmd.org, it creates directory bvt.gbhlmd.org but not the necessary directory structure for ZF. The error that I am having on the console screen is Creating project at /var/www/html/bvt.gbhlmd.org
    PHP Fatal error: Class 'DOMDocument' not found in /usr/local/ZendFrameworkCli/library/Zend/Tool/Project/Profile/FileParser/Xml.php on line 74

    Fatal error: Class 'DOMDocument' not found in /usr/local/ZendFrameworkCli/library/Zend/Tool/Project/Profile/FileParser/Xml.php on line 74

    I am using Fedora 11 with PHP version 5.2.9. Should I try to download ZF again or there is a another way out.

    Thank you

  152. 152 Erdal

    Rob,

    Problem is solved. PHP was complied without DOM extension in Fedora 11.

    Just for information,
    #yum install php-dom

  153. 153 Anshul

    Hello
    I am not understanding it correctly .
    can someone help me one by one .

    Thanks

  154. 154 Ondoy

    on #79 @Colandy,
    You might want to enable these on your php.ini

    extension=php_pdo.dll
    extension=php_pdo_mysql.dll

  155. 155 Dau

    Thank you so much! I've spent the last two days struggling.. Unfortunately many of the Zend framework tutorials on the web are outdated, which leads to a lot of frustration and confusion.. You've helped a lot..

  156. 156 Rob...

    Erdal,

    You should install the DOM extension for PHP. Consult the documentation for your distribution on how to do this.

    Regards,

    Rob...

  157. 157 swaina

    Hi,

    Very good tutorial , thank you for that.
    Hi, have a little problem, when I put the AllOverride to All in httpd.conf my public folder (where is my .htaccess) can't be access anymore and I have ".htaccess: RewriteEngine must be On or Off" in my error.log

    If I don't put the "all" it's work but I can't have add,edit and others.

    can somebody help me ?

  158. 158 ragtek

    It should be allowoverride and not allOverride or?

  159. 159 Erdal

    @ragtek
    AllowOverride All

  160. 160 ragtek

    I referred on swaina

    "when I put the AllOverride to All...."

  161. 161 Erdal

    If you are using Apache(I assume you are) you must uncomment the line

    LoadModule rewrite_module modules/mod_rewrite.so

    And the change AllowOverride None to All. Use the zf command li,ne to create your project. be sure you have enough permission on your web server directory.

    If you are still having problems check your web server logs.

  162. 162 Jay

    Fix for earlier reported mysql socket error:

    This fixed it:
    sudo ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock.

    Great tutorial it is up and running. Works very well with Zend Server. Do not have to download ZF separately. Debugging environment works great with Zend studio also.

  163. 163 Jay

    Looks like my first message did not post. The problem was that web site coul not connect to MySQL and complaining of a socket error. (There seems to be some kind of problem between Zend Server and

    The platform was Ubuntu, Zend Server, and Zend Studio. No separate ZF was downloaded. Just made the minor required tweaks.

    Worked like a

  164. 164 Michael B.

    Hello, Rob!

    Do you still intends to update your tutorial? Looking forward to it! :)

  165. 165 Rob...

    Michael B,

    Of course :)

    There's nothing in 1.9 that affects it from what I can tell, but I'm hoping to do an updated PDF this week, once I've tested.

    Regards,

    Rob...

  166. 166 網站製作學習誌 » [PHP-ZF] Front Controller 的基本應用技

    [...] Rob Allen 寫的 Getting Started with the Zend Framework 一文 (PDF 版本) [...]

  167. 167 Richard

    Using a symbolic link to fix the mysql socket error is only a short term fix as the /tmp directory may get cleared out.

    Instead add to application.ini:
    resources.db.params.unix_socket = /var/lib/mysql/mysql.sock

    Apparently PDO_MYSQL doesn't have a default socket directive in 5.2 but it will in 5.3 so this will no longer be necessary

  168. 168 Brian

    Hi,

    Is your book cover ZF 1.9 or some previous version.

    Thanks

  169. 169 Link utili a tutorial per Zend Framework « Roberto @ H-Art

    [...] Link utili a tutorial per Zend Framework Buon tutorial per iniziare ad utilizzare Zend Framework. Esiste la possibilità di scaricarlo in formato PDF: http://akrabat.com/zend-framework-tutorial/ [...]

  170. 170 Michael B.

    There is a string in the layout.phtml (page 10):
    $this->escape($this->title)
    But it returns nothing. So i add to bootstrap.php
    $view->title = "Zend tutorial"

    I wonder if it is a right solution...

  171. 171 Michael B.

    Oh, sorry, my bad. The "title" will be declared later in the IndexController.php.

  172. 172 Rafael Izidoro

    I solved the problem with baseUrl(). The problem is that I develop in Windows, and in some views I call baseURL with URL upcase, but the class file is BaseUrl.php, so in Linux the plugin file was not found. Solution: Always call baseUrl() rather than baseURL().

  173. 173 Markus

    Hello

    Great tutorial, if i want to make a ajax based version (preferrably prototype), how would you structure the app?

    I prefer to use JSON as the exchange data between the client and the serverside, so most of the html-generation will reside on the server.

    Are there any best practices on ajax and zend framework

  174. 174 snek

    @Jb
    Your note on resources.view[] = in application.ini indeed fixed my problem for baseUrl! Thanks so much, I was already getting a bit frustrated as to why it wouldn't work for me since it seemed to be searching in the right directories!

  175. 175 Gabriela

    Hi,

    Now I tried your tutorial step by step and it wasn't work.

    It showed me this message:

    My Albums
    An error occurred
    Application error

  176. 176 Rob Allen’s Blog: Three years of my Zend Framework Tutorial | Webs Developer

    [...] can grab the latest version of the tutorial (supporting ZF 1.9) from his site as well as pick up a copy of the Zend Framework [...]

  177. 177 Rob Allen’s Blog: Three years of my Zend Framework Tutorial | PHP

    [...] can grab the latest version of the tutorial (supporting ZF 1.9) from his site as well as pick up a copy of the Zend Framework [...]

  178. 178 philip

    Hi Rob,
    Great tutorials. I tried to initialize Zend_Layout in Bootstrap as you have shown. But I get a "Circular Reference" error. What should I do? I'm using Zend framework 1.91.

    Thanks,
    PHilip

  179. 179 Alexandre

    Hello,

    I've got a similar problem as Gabriela.
    I installed on a virtual Turnkey LAMP. Everything worked fine, until I had to make a connection to the database. I checked al the paramaters in application.ini to be shure I didn't have a typo, but they are ok. I also downloaded the code from this page, but that gives the same problem.
    Could it be that Zend can't find my database? Or is there any other reasson why I get that error?
    Nevertheless like Zend a lot.

  180. 180 Gabriela

    Hi Alexandre, I could fix the error. I work with mysql and I had to change the application.ini this way: in [production]

    resources.db.adapter = PDO_MYSQL
    resources.db.params.host = localhost
    resources.db.params.username = root
    resources.db.params.password = ****
    resources.db.params.dbname = zf_tutorial
    resources.db.isDefaultTableAdapter = true

  181. 181 andy

    Hi Gabriela, I'm getting the same problem as both you & Alexandre but all I can see is that you have added the line

    resources.db.isDefaultTableAdapter = true

    But this doesn't help me, am I missing something?

  182. 182 Os primeiros passos com Zend Framework « Diorgenes Felipe Grzesiuk

    [...] em uma tabela no banco de dados postgreSQL. Para conseguir realizar esses passos o tutorial Getting Started with Zend Framework me ajudou [...]

  183. 183 Yujin

    I am trying to study Zend Framework. The Quickstart in their site look like difficult start. 3 files for model. I am now following this tutorial. Looks easier than zend site.

    In the tutorial, there is a spelling mistage.

    ----
    Zend_Layout will now look for a layout view script called layout.phml
    ----

    layout.phml instead of layout.phtml

  184. 184 DK

    Hi,

    I'm trying to go through the tutorial v1.6.3 and are stuck with some fatal errors. I get these errors when I use $this->headMeta(); and $this->headLink()->prependStylesheet($this->baseUrl().'/css/site.css'); in the layout.phtml file.
    I would be very grateful if someone could explain to me what the error is due to and how I can solve it.

    Thanks in advance,
    DK

    =====
    Fatal error: Call to undefined method Zend_View_Helper_Placeholder_Container::ksort() in /Applications/MAMP/htdocs/zf-tutorial/library/Zend/View/Helper/HeadMeta.php on line 333

    Fatal error: Call to undefined method Zend_View_Helper_Placeholder_Container::ksort() in /Applications/MAMP/htdocs/zf-tutorial/library/Zend/View/Helper/HeadLink.php on line 311
    =====

  185. 185 Doglas

    Hello!

    Thanks for a great tutorial Rob and I look forward to reading ZFiA.

    Unfortunately I've got some problem although I followed the tutorial step by step. I think the problem is that I can not access the database.

    The error message I get is:
    Warning: Invalid argument supplied for foreach() in ~/zf-tutorial/application/views/scripts/index/index.phtml on line 9

    ~/index.phtml:
    8
    9 albums as $album) : ?>
    10
    11 escape($album->title);?>
    12 escape($album->artist);?>
    13
    14 <a href="url(array('controller'=>'index',
    15 'action'=>'edit', 'id'=>$album->id));?>">Edit
    16 <a href="url(array('controller'=>'index',
    17 'action'=>'delete', 'id'=>$album->id));?>">Delete
    18
    19
    20
    21

    Regards,

    Doglas

  186. 186 frankmail007

    Greate tutorial. But I can't get it work when I'm trying to create actions. I got the folowing error:

    An Error Has Occurred
    A project profile was not found.

    My zend version is 1.9.0 and my php is 5.3.0.

    Any suggestion? Thanks

  187. 187 Rob...

    frankmail007,

    Use 1.8.4 on Windows. Though 1.9.1 may have fixed the problem...

    Regards,

    Rob...

  188. 188 Will Rourke

    Hi, apologies if this is the wrong place, I found an old comment that mentioned writing up your experiences getting ZF to work with IIS, did you ever get round to that? I'm in that zone right now using IIS5.1 and IIRF to do the URL rewrites, but will it work? will it f....

    Any hints or links gratefully received

    cheers
    W

  189. 189 phillip

    Hi frankmail007,
    You have to change the current directory to the project where you want the action to be created.
    cd C:\path to\MVC project\

    Zend Framework 1.9.0 has some errors when the command line is used. 1.9.1 has solved it.

    Phillip

  190. 190 ck

    Rob thanks for the excellent, well written, and easy to understand article on zf 1.9.

    I have one query though on the pdf version of ZFiA - it doesn't seem to cover zf 1.9?

    I only bought it last week and was a little suprised the PDF had not been updated to the current version?

    Could you not create some 1.9 errata, showing the changes?

  191. 191 Anandhi

    Good tutorial.
    Every thing works perfectly.
    Thnzzzz

  192. 192 Jeremy

    Hello !
    First of all, thanks a lot for this wonderful tutorial, it really helped me get started with this marvelous framework.

    There is a problem though. It seems like the single quotes aren't escaped correctly when editing an item. It can be seen when you edit "It's Not me it's you" for example and submit without changing anything. Every time you do that, it adds a bunch of backslashes before the " ' ". I have no idea how to fix that though.

    Regards,
    Jeremy

  193. 193 Jeremy

    Nevermind, this was caused by my magic_quotes_gpc PHP setting being ON... Thanks again for the great tutorial.

  194. 194 Rob...

    Will,

    My experience is here: http://akrabat.com/2008/06/03/zend-framework-urls-without-mod_rewrite/

    Regards,

    Rob...

  195. 195 Rob...

    ck,

    ZFiA's PDF matches the published book. The way the book worked was that I submitted the manuscript and after editing the book was published. There is no mechanism for significantly rewriting it for updated ZF versions. However, the most significant thing that breaks is Zend_Loader which is trivially fixed and now noted at the top of the errata.

    I'd love to update the Places application for 1.9, but it's on my to do list under the Zend_Auth tutorial update :(

    Regards,

    Rob...

  196. 196 Rob...

    Jeremy,

    Turn off "magic_quotes_gpc" in your php.ini file.

    (edit: One of the downsides of replying whilst going through the moderation queue, is that I didn't see that you'd solved it yourself!)

    Regards,

    Rob...

  197. 197 ck

    Zend Framework in Action Errata:

    http://www.zendframeworkinaction.com/errata/

    Thanks Rob.

  198. 198 ck

    Rob I found a typo:

    page 10: (layout.phtml)

    $this->headMeta();

    page 11: (layout.phtml)

    $this->HeadMeta();

  199. 199 Rob...

    ck,

    Thanks - fixed in my master source version :)

    Regards,

    Rob...

  200. 200 ck

    Rob, any ideas on this one?

    Fatal error: Using $this when not in object context in /zfprojects/zf-tutorial/application/views/scripts/index/add.phtml on line 1

    Thats the result when i click Add new album.

  201. 201 David Mintz

    I bought and read ZF In Action and I'm glad I didn't procrastinate, ZF being such a fast-moving target. Fine book, but alas, inevitably... now dated.

    In your copious leisure time, are you working on a next edition of Zend Framework In Action?

  202. 202 Rob...

    ck,

    That's an odd one. It implies that the add.phtml file is being manually included somewhere.

    Regards,

    Rob...

  203. 203 Rob...

    David,

    Free time?!? ha ha ha ha ha!

    Whilst ZFiA doesn't cover the new bells and whistles, the majority of it is still current.

    Regards,

    Rob...

  204. 204 Zend Framework Tutorials « Silly Bits (and Bytes)

    [...] Akra's tutorial: Somewhat more advanced than the quick start tutorial. It is a nice introduction to some more concepts, even though Arka's approach does not always follow the MVC pattern. [...]

  205. 205 phil

    Hi Rob,

    My Zend_Form elements are not displayed at all. I have the Moduel_autoloader in the bootstrap,and I have echoed out the form in the corresponding view. But none of the elements that I set up are displayed. I am using Zend Framework 1.9.2 and Vista. The error I receive is this:message ?>
    Exception information:

    Message: exception->getMessage() ?>
    Stack trace:

    exception->getTraceAsString() ?>

    Request Parameters:

    request->getParams()) ?>

    Thanks in advance,

    Phil

  206. 206 Rob Allen’s Blog: Tutorial Q&A PDF | PHP

    [...] Rob Allen has pointed out a Q&A PDF that consolidates some of the common issues that people have had on Rob's Zend Framework tutorial. [...]

  207. 207 Rob Allen’s Blog: Tutorial Q&A PDF | Webs Developer

    [...] Rob Allen has pointed out a Q&A PDF that consolidates some of the common issues that people have had on Rob's Zend Framework tutorial. [...]

  208. 208 Rob...

    Phil,

    Enable short open tags or fix the template to not use them :)

    Regards,

    Rob...

  209. 209 zend framework 站点推荐 | Jackie’s Blog

    [...] http://akrabat.com/zend-framework-tutorial/ [...]

  210. 210 Brett

    Rob,

    I'm getting the same error that Paul was getting.

    Parse error: parse error, expecting `'{'' in /usr/local/ZendFrameworkCli/library/Zend/Tool/Framework/Client/Console.php on line 63

    It's very frustrating!

  211. 211 basic zend form ! not able to get it work ! - Zend Framework Forum

    [...] This is happening whilst trying to do the ZF tutorial here: Akra's DevNotes Tutorial: Getting Started with Zend Framework 1.9 I have spoken to Rob (author) who is on the ZF Educational Advisor board and he says: "It [...]

  212. 212 Orkan

    Hi there,

    first off i like to thank you for this nice tutorial. it's way better then the quickstart on zend hp. your descriptions are a lot better and easy to understand.

    but after finishing all i stumbled over this strange problem:
    listing, add and delete works fine, but when i try to edit an album, all i see is the header with correct headline and after that the code in the editAction...

    ...
    Edit album
    $this->view->title = "Edit album";
    $this->view->headTitle($this->view->title, 'PREPEND');
    ...

    do you have a clue what could be the problem here?

    i use zf 1.9.2 and php 5.3

    thanks in advance

  213. 213 larreh

    Rob,

    Thanks so much for this tutorial, as well as all of the other work you do in the ZF community. It is appreciated!

  214. 214 Rob...

    Orkan,

    Are you using short open tags in the edit.phtml?

    Rob...

  215. 215 Orkan

    what a silly mistake... ty for the hint :)

    it wasn't the short tags, i just forgot the php tags completely. plus i pasted the wrong code into the view.

  216. 216 blog.about-orkan.de » Blog Archive » Guter Einstieg ins Zend Framework

    [...] weitaus besseres Einsteigertutorial findet man auf Akra's DevNote. Der Umfang ist dem des Quickstart Tutorials ähnlich, etwas schlanker, aber deutlich besser [...]

  217. 217 Magnus von Bromsen

    Hello Rob

    Thanks for the tutorial " and a very good book :)

    I did your tutorial a while ago (ZF 1.8), but now I wanted to refresh myself. But this time, I get a error when using Zend Tool:

    PHP Fatal error: Cannot redeclare class Zend_Loader in /Applications/MAMP/htdocs/zftut/library/Zend/Loader.php on line 31

    Fatal error: Cannot redeclare class Zend_Loader in /Applications/MAMP/htdocs/zftut/library/Zend/Loader.php on line 31

    I'm using the latest MAMP and Mac OS X 10.6.
    Any idea where the error is?

    -- magnus

  218. 218 ck

    If you are currently having problems getting this tutorial to work, try this:

    (1) download and read the FAQ PDF as this collates all the comments above.

    (2) delete your code, and use the zipped code files.

    If the application fails to work after you have done this, and you are sure that you have uploaded and un-packed it correctly, then you have one further choice:

    (3) move hosting providers. :(

    I was stuck on a 'problem' for 2 weeks and was told by (our excellent non-zf host) that 'it was a coding issue'.

    As it turns out, it was not, but was due to the way that ZF and its projects had been setup.

    In the last 6 years I have used around 10 hosting providers and NONE of these could get ZF working.

    However I have now found, in my opinion, clearly one of the best Zend Framework hosting companies around.

    I say this becuase they not only understand ZF but more importantly were willing to PROVE that they can get this tutorial setup and working before I signed up!

    http://www.servergrove.com

    Just ask for Pablo (live chat) and I think in a short amount of time you will see how professional and responsive this company is.

    One thing though, they are based in the USA, so if you from Europe - be sure to ask them about setting up servers in the Europe - somthing which I know they are looking at

  219. 219 Pablo - ServerGrove

    Hello,

    I appreciate the previous post, but I wanted to make clear that it was posted by one of our customers and not by us.

    Regards,
    Pablo

  220. 220 Rob...

    Pablo,

    I have updated to make this clear.

    Thanks for commenting.

    Rob...

  221. 221 Pablo

    @Magnus,

    I had that problem before and it was due to the library being in the include path so PHP tried to include Zend_Loader twice.

  222. 222 Marc

    Although plugins aren't a part of the tutorial, I'm hoping someone can assist me with a simple problem that has me hung up.

    I'm simply trying to register a plug in and using this simple code:

    //load a new namespace
    $autoloader = Zend_Loader_Autoloader::getInstance();
    $autoloader->registerNamespace('Mac_');
    // load a new plug in
    $bootstrap = $application->getBootstrap();
    $bootstrap->registerPluginResource(new Mac_Controller_Plugin_Test());

    No matter how simple my plug in is, I get:
    Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Invalid resource provided to Zend_Application_Bootstrap_BootstrapAbstract::registerPluginResource' in...

    I do have some modules in place in the set up, but they all work fine when the plugin code is removed.

    I'm really scratching my head and would gladly send along more details if someone can chime in.

    Rob -- your tutorial is superb!

  223. 223 Magnus von Bromsen

    @Pablo,
    I have not added ZF library to the include path in php.ini (I think ;).

    But, I tried with ZF 1.8, followed Akra's tutorial (as before) and everything works perfekt :)

    Maybe it is something with the combination MAMP (php 5.2.10) and ZF 1.9?

    -- Magnus

  224. 224 Marc

    Rob -- I bought your book when it first came out and I'm wondering if there is any place where updates to the code are indicated, based on 1.8 or 1.9. I've visited the sandbox forum, but the chapter corrections submitted there don't appear to correspond to the same sections of the book.

    For example, I'm no sure why my model class cannot begin:
    class Places extends Zend_Db_Table_Abstract

    and then instantiated in the controller as:
    new Places()

    but it does work as:
    class Model_DbTable_Places extends Zend_Db_Table_Abstract
    new Model_DbTable_Places()

    When I look at the online ZF ref guide, it appears that the first approach should be fine (as discussed in your book), but then in this tutorial you use the second approach.

    Am I missing something?

    Thanks!

  225. 225 Marc

    Ugh -- I just discovered the post mentioning the errata. Thanks!

    Still not clear on why this wont work:
    class Places extends Zend_Db_Table_Abstract

  226. 226 Rob...

    Marc,

    With ZF 1.8+, the easiest way to use new Places directly is to put the models directory on your include_path and enabled the fallback autoloader. See this post.

    Regards,

    Rob...

  227. 227 Jim

    Hi,
    Just installed Apache/2.2.11 (Win32) PHP/5.2.10 configured with Zend Framework version 1.8.4.

    When I test out the initial URL of:

    http://localhost/zf-tutorial/public

    it displays the error.phtml page.

    If I test out using

    http://localhost/zf-tutorial/public/index.php

    then it displays the "Welcome to Zend Framework" screen as it should. This means that when I test out the added "add" "edit" "delete" actions it fails too.

    I installed the zf-tutorial under:

    C:\webprojects\var\www\html\zf-tutorial

    files:

    hosts
    127.0.0.1 zf-tutorial

    hostsd.conf

    #
    # This is the main Apache HTTP server configuration file. It contains the
    # configuration directives that give the server its instructions.
    # See for detailed information.
    # In particular, see
    #
    # for a discussion of each configuration directive.
    #
    # Do NOT simply read the instructions in here without understanding
    # what they do. They're here only as hints or reminders. If you are unsure
    # consult the online docs. You have been warned.
    #
    # Configuration and logfile names: If the filenames you specify for many
    # of the server's control files begin with "/" (or "drive:/" for Win32), the
    # server will use that explicit path. If the filenames do *not* begin
    # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
    # with ServerRoot set to "C:/Program Files/Apache Software Foundation/Apache2.2" will be interpreted by the
    # server as "C:/Program Files/Apache Software Foundation/Apache2.2/logs/foo.log".
    #
    # NOTE: Where filenames are specified, you must use forward slashes
    # instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
    # If a drive letter is omitted, the drive on which httpd.exe is located
    # will be used by default. It is recommended that you always supply
    # an explicit drive letter in absolute paths to avoid confusion.

    #
    # ServerRoot: The top of the directory tree under which the server's
    # configuration, error, and log files are kept.
    #
    # Do not add a slash at the end of the directory path. If you point
    # ServerRoot at a non-local disk, be sure to point the LockFile directive
    # at a local disk. If you wish to share the same ServerRoot for multiple
    # httpd daemons, you will need to change at least LockFile and PidFile.
    #
    ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"

    #
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the
    # directive.
    #
    # Change this to Listen on specific IP addresses as shown below to
    # prevent Apache from glomming onto all bound IP addresses.
    #
    #Listen 12.34.56.78:80
    Listen 80

    #
    # Dynamic Shared Object (DSO) Support
    #
    # To be able to use the functionality of a module which was built as a DSO you
    # have to place corresponding `LoadModule' lines at this location so the
    # directives contained in it are actually available _before_ they are used.
    # Statically compiled modules (those listed by `httpd -l') do not need
    # to be loaded here.
    #
    # Example:
    # LoadModule foo_module modules/mod_foo.so
    #
    LoadModule actions_module modules/mod_actions.so
    LoadModule alias_module modules/mod_alias.so
    LoadModule asis_module modules/mod_asis.so
    LoadModule auth_basic_module modules/mod_auth_basic.so
    #LoadModule auth_digest_module modules/mod_auth_digest.so
    #LoadModule authn_alias_module modules/mod_authn_alias.so
    #LoadModule authn_anon_module modules/mod_authn_anon.so
    #LoadModule authn_dbd_module modules/mod_authn_dbd.so
    #LoadModule authn_dbm_module modules/mod_authn_dbm.so
    LoadModule authn_default_module modules/mod_authn_default.so
    LoadModule authn_file_module modules/mod_authn_file.so
    #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
    #LoadModule authz_dbm_module modules/mod_authz_dbm.so
    LoadModule authz_default_module modules/mod_authz_default.so
    LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
    LoadModule authz_host_module modules/mod_authz_host.so
    #LoadModule authz_owner_module modules/mod_authz_owner.so
    LoadModule authz_user_module modules/mod_authz_user.so
    LoadModule autoindex_module modules/mod_autoindex.so
    #LoadModule cache_module modules/mod_cache.so
    #LoadModule cern_meta_module modules/mod_cern_meta.so
    LoadModule cgi_module modules/mod_cgi.so
    #LoadModule charset_lite_module modules/mod_charset_lite.so
    #LoadModule dav_module modules/mod_dav.so
    #LoadModule dav_fs_module modules/mod_dav_fs.so
    #LoadModule dav_lock_module modules/mod_dav_lock.so
    #LoadModule dbd_module modules/mod_dbd.so
    #LoadModule deflate_module modules/mod_deflate.so
    LoadModule dir_module modules/mod_dir.so
    #LoadModule disk_cache_module modules/mod_disk_cache.so
    #LoadModule dumpio_module modules/mod_dumpio.so
    LoadModule env_module modules/mod_env.so
    #LoadModule expires_module modules/mod_expires.so
    #LoadModule ext_filter_module modules/mod_ext_filter.so
    #LoadModule file_cache_module modules/mod_file_cache.so
    #LoadModule filter_module modules/mod_filter.so
    #LoadModule headers_module modules/mod_headers.so
    #LoadModule ident_module modules/mod_ident.so
    #LoadModule imagemap_module modules/mod_imagemap.so
    LoadModule include_module modules/mod_include.so
    #LoadModule info_module modules/mod_info.so
    LoadModule isapi_module modules/mod_isapi.so
    #LoadModule ldap_module modules/mod_ldap.so
    #LoadModule logio_module modules/mod_logio.so
    LoadModule log_config_module modules/mod_log_config.so
    #LoadModule log_forensic_module modules/mod_log_forensic.so
    #LoadModule mem_cache_module modules/mod_mem_cache.so
    LoadModule mime_module modules/mod_mime.so
    #LoadModule mime_magic_module modules/mod_mime_magic.so
    LoadModule negotiation_module modules/mod_negotiation.so
    #LoadModule proxy_module modules/mod_proxy.so
    #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    #LoadModule proxy_connect_module modules/mod_proxy_connect.so
    #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    #LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule rewrite_module modules/mod_rewrite.so
    LoadModule setenvif_module modules/mod_setenvif.so
    #LoadModule speling_module modules/mod_speling.so
    #LoadModule ssl_module modules/mod_ssl.so
    #LoadModule status_module modules/mod_status.so
    #LoadModule substitute_module modules/mod_substitute.so
    #LoadModule unique_id_module modules/mod_unique_id.so
    #LoadModule userdir_module modules/mod_userdir.so
    #LoadModule usertrack_module modules/mod_usertrack.so
    #LoadModule version_module modules/mod_version.so
    #LoadModule vhost_alias_module modules/mod_vhost_alias.so

    #
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch.
    #
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    #
    User daemon
    Group daemon

    # 'Main' server configuration
    #
    # The directives in this section set up the values used by the 'main'
    # server, which responds to any requests that aren't handled by a
    # definition. These values also provide defaults for
    # any containers you may define later in the file.
    #
    # All of these directives may appear inside containers,
    # in which case these default settings will be overridden for the
    # virtual host being defined.
    #

    #
    # ServerAdmin: Your address, where problems with the server should be
    # e-mailed. This address appears on some server-generated pages, such
    # as error documents. e.g. admin@your-domain.com
    #
    ServerAdmin email@my.domain.com

    #
    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    #
    # If your host doesn't have a registered DNS name, enter its IP address here.
    #
    #ServerName my_ip_name:80

    #
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    #DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
    DocumentRoot "C:/webprojects/var/www/html/zf-tutorial/public"

    #
    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories).
    #
    # First, we configure the "default" to be a very restrictive set of
    # features.
    #

    AllowOverride All

    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #

    DirectoryIndex index.php index.html

    #
    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    #

    Order allow,deny
    Deny from all
    Satisfy All

    #
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a
    # container, error messages relating to that virtual host will be
    # logged here. If you *do* define an error logfile for a
    # container, that host's errors will be logged there and not here.
    #
    ErrorLog "logs/error.log"

    #
    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    #
    LogLevel debug

    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    # You need to enable mod_logio.c to use %I and %O
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a
    # container, they will be logged here. Contrariwise, if you *do*
    # define per- access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
    CustomLog "logs/access.log" common

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog "logs/access.log" combined

    #
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://my_ip_name/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL. You will also likely
    # need to provide a section to allow access to
    # the filesystem path.

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client. The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"

    #
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    #
    #Scriptsock logs/cgisock

    #
    # "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    #
    # AllowOverride None
    # Options None
    # Order allow,deny
    # Allow from all
    #

    #
    # DefaultType: the default MIME type the server will use for a document
    # if it cannot otherwise determine one, such as from filename extensions.
    # If your server contains mostly text or HTML documents, "text/plain" is
    # a good value. If most of your content is binary, such as applications
    # or images, you may want to use "application/octet-stream" instead to
    # keep browsers from trying to display binary files as though they are
    # text.
    #
    DefaultType text/plain

    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml

    #
    # The mod_mime_magic module allows the server to use various hints from the
    # contents of the file itself to determine its type. The MIMEMagicFile
    # directive tells the module where the hint definitions are located.
    #
    #MIMEMagicFile conf/magic

    #
    # Customizable error responses come in three flavors:
    # 1) plain text 2) local redirects 3) external redirects
    #
    # Some examples:
    #ErrorDocument 500 "The server made a boo boo."
    #ErrorDocument 404 /missing.html
    #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    #ErrorDocument 402 http://my_ip_name/subscription_info.html
    #

    #
    # EnableMMAP and EnableSendfile: On systems that support it,
    # memory-mapping or the sendfile syscall is used to deliver
    # files. This usually improves server performance, but must
    # be turned off when serving from networked-mounted
    # filesystems or if support for these functions is otherwise
    # broken on your system.
    #
    #EnableMMAP off
    #EnableSendfile off

    # Supplemental configuration
    #
    # The configuration files in the conf/extra/ directory can be
    # included to add extra features or to modify the default configuration of
    # the server, or you may simply copy their contents here and change as
    # necessary.

    # Server-pool management (MPM specific)
    #Include conf/extra/httpd-mpm.conf

    # Multi-language error messages
    #Include conf/extra/httpd-multilang-errordoc.conf

    # Fancy directory listings
    #Include conf/extra/httpd-autoindex.conf

    # Language settings
    #Include conf/extra/httpd-languages.conf

    # User home directories
    #Include conf/extra/httpd-userdir.conf

    # Real-time info on requests and configuration
    #Include conf/extra/httpd-info.conf

    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf

    # Local access to the Apache HTTP Server Manual
    #Include conf/extra/httpd-manual.conf

    # Distributed authoring and versioning (WebDAV)
    #Include conf/extra/httpd-dav.conf

    # Various default settings
    #Include conf/extra/httpd-default.conf

    # Secure (SSL/TLS) connections
    #Include conf/extra/httpd-ssl.conf
    #
    # Note: The following must must be present to support
    # starting without SSL on platforms with no /dev/random equivalent
    # but a statically compiled-in mod_ssl.
    #

    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin

    #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
    PHPIniDir "C:/PHP/"
    LoadModule php5_module "C:/PHP/php5apache2_2.dll"
    #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

    .htaccess is default:

    SetEnv APPLICATION_ENV development

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]

    access.log file shows:

    when I specify http://localhost/zf-tutorial/public:
    127.0.0.1 - - [17/Sep/2009:13:59:20 -0500] "GET /zf-tutorial/public HTTP/1.1" 404 726

    when I specify http://localhost/zf-tutorial/public/index.php:
    127.0.0.1 - - [17/Sep/2009:14:01:51 -0500] "GET /zf-tutorial/public/index.php HTTP/1.1" 200 1087

    It's like the .htaccess isn't getting used but I've tried setting the options +FollowSymLinks but that didn't help either.

    Any help would be greatly appreciated...

  228. 228 Hari K T

    Hi Rob,
    Your site has really helped me when I started learning Zend framework . I have been trying with the ZF commands and now I have created a small simple blog application . Many are still not developed . I have implemented the Zend_ACL , Zend_Auth and added a gallery which shows the pictures of users from picasa .
    I have posted in my blog if it helps some one to recognise some more clear . I am totally new so there may be errors .
    So I am dedicating this to you and the guys who have helped me to learn it .

    Thanks

  229. 229 alessandro castro » Vou inicial o estudo de Zend Framework a partir do Akra’s Tutorial

    [...] Akra’s DevNotes Tutorial: Getting Started with Zend Framework 1.9 [...]

  230. 230 José Marques

    Hello

    I'm new to zend framework.
    I followed he steps but i get this error when i try do view http://zend_cds.local (index page)

    My Albums
    An error occurred
    Application error
    Exception information:
    Message:

    Stack trace:
    #0 D:\webdev\zend_cds\library\Zend\Db\Adapter\Pdo\Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
    #1 D:\webdev\zend_cds\library\Zend\Db\Adapter\Abstract.php(448): Zend_Db_Adapter_Pdo_Mysql->_connect()
    #2 D:\webdev\zend_cds\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('DESCRIBE `album...', Array)
    #3 D:\webdev\zend_cds\library\Zend\Db\Adapter\Pdo\Mysql.php(156): Zend_Db_Adapter_Pdo_Abstract->query('DESCRIBE `album...')
    #4 D:\webdev\zend_cds\library\Zend\Db\Table\Abstract.php(814): Zend_Db_Adapter_Pdo_Mysql->describeTable('albums', NULL)
    #5 D:\webdev\zend_cds\library\Zend\Db\Table\Abstract.php(857): Zend_Db_Table_Abstract->_setupMetadata()
    #6 D:\webdev\zend_cds\library\Zend\Db\Table\Abstract.php(964): Zend_Db_Table_Abstract->_setupPrimaryKey()
    #7 D:\webdev\zend_cds\library\Zend\Db\Table\Select.php(100): Zend_Db_Table_Abstract->info()
    #8 D:\webdev\zend_cds\library\Zend\Db\Table\Select.php(78): Zend_Db_Table_Select->setTable(Object(Model_DbTable_Albums))
    #9 D:\webdev\zend_cds\library\Zend\Db\Table\Abstract.php(1000): Zend_Db_Table_Select->__construct(Object(Model_DbTable_Albums))
    #10 D:\webdev\zend_cds\library\Zend\Db\Table\Abstract.php(1286): Zend_Db_Table_Abstract->select()
    #11 D:\webdev\zend_cds\application\controllers\IndexController.php(17): Zend_Db_Table_Abstract->fetchAll()
    #12 D:\webdev\zend_cds\library\Zend\Controller\Action.php(513): IndexController->indexAction()
    #13 D:\webdev\zend_cds\library\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('indexAction')
    #14 D:\webdev\zend_cds\library\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #15 D:\webdev\zend_cds\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
    #16 D:\webdev\zend_cds\library\Zend\Application.php(346): Zend_Application_Bootstrap_Bootstrap->run()
    #17 D:\webdev\zend_cds\public\index.php(25): Zend_Application->run()
    #18 {main}
    Request Parameters:
    array(3) {
    ["controller"]=>
    string(5) "index"
    ["action"]=>
    string(5) "index"
    ["module"]=>
    string(7) "default"
    }

    Can you please help me,
    Don't really know ehat might be the problem.

    This is my config file
    [production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    phpSettings.date.timezone = "UTC"
    includePaths.library = APPLICATION_PATH "/../library"
    bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
    bootstrap.class = "Bootstrap"
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    resources.db.adapter = "PDO_MYSQL"
    resources.db.params.host = "localhost"
    resources.db.params.username = "root"
    resources.db.params.password = "qwerty"
    resources.db.params.dbname = "zend_cds"
    resources.layout.layoutpath = APPLICATION_PATH "/layouts"

    Thanks

  231. 231 José Marques

    I'm usinf ZF version 1.9.2.

  232. 232 cassiopeia

    Hi, Rob,
    thanks for the tutorial.

    I translate your tutorial into Japanese.
    http://web-rhodia.com/zf-tutorial/

    Best Regards.

  233. 233 Magnus von Bromsen

    Hi

    When trying to add, edit or delete an album I get this error:

    Warning: include(/Applications/MAMP/htdocs/zftest/application/forms//Album.php) [function.include]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/zftest/library/Zend/Loader/Autoloader/Resource.php on line 176

    Warning: include() [function.include]: Failed opening '/Applications/MAMP/htdocs/zftest/application/forms//Album.php' for inclusion (include_path='/Applications/MAMP/htdocs/zftest/library:.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/zftest/library/Zend/Loader/Autoloader/Resource.php on line 176

    Fatal error: Class 'Form_Album' not found in /Applications/MAMP/htdocs/zftest/application/controllers/IndexController.php on line 24

    I think it is because of a double slash between "form" and "album.php" in the url.

    But how do I get rid of that?

    -- magnus

  234. 234 Iyngaran Iyathurai

    I have a problem with Zend_Db_Table_Abstract class

    In the code you are using the following tow lines, And its fetching the data from the database table..
    $albums = new Model_DbTable_Albums();
    $this->view->albums = $albums->fetchAll();

    My problem is, where we opening the database and closing? I couldn't see a code to open the db, and close the db. But for my application i need to do that. How can i do that ? and Y u didn't do that in this code.

    Thanks
    Iyngaran Iyathurai

  235. 235 Hari K T

    @Iyngaran Iyathurai : You may need to look http://framework.zend.com/manual/en/zend.db.table.html and also look the class Model_DbTable_Albums itself .
    Also ZF is used for RAD , so we don't need to use the old way of opening and closing with out a framework.

  236. 236 Bags

    Just a quick comment regarding the setup of php for the zend framework tutorial. Some part of the Zend Framework library is using short php open tags. The importance of setting short_open_tag=on in php.ini should be empasised somewhere in the documentation, probably in the Tutorial Assumptions section of the Getting Started document.
    I have also found it easier to set the php include_path to the zend framework library so an empty library directory in the demos does not matter.

    I suggest this because the default settings of my WAMP install (and probably everyone elses) has short_open_tag=off and makes the demo application display an uninformative and disappointing screen as detailed above by Phil on the 2nd Sep. I was expecting to get some error message as I hadn't set up the database, but the message displayed was very dejecting.

  237. 237 NealB

    I just finished the v1.6.3 pdf version of this tutorial, downloaded from the link at the top of this page.

    First I just wanted to say thanks. What a great walk-thru! I'm pretty much brand new to PHP and ZF (coming from VB and ASP.NET background). I especially appreciated all the notes and details, e.g. about Apache config settings required, or the info about the problems with the 1.9.0 version of Zend_Tool in Windows. I'd encountered those issues in other tutorials / books I've been studying and when I did I had to go digging around to find the solutions. It's fantastic that they're all explained right here within the tutorial. In short, I wish I'd started my PHP/ZF introduction with this tutuorial.

    End of kudo. One note on the code in the pdf (v1.6.3) from page 17 of 18 (delete.phtml), my PDT editor window put a warning underline under:

    <form action="url(array('action'=>'delete')); ?>"
    method="post">

    No end tag (). Double-checked and it is missing from the code in the pdf. It doesn't break the page, but I thought I'd mention it.

  238. 238 Void

    @Magnus

    I ran into the same problem when I downloaded the latest version of ZF (1.9.3PL1) and started following the v1.6.3 tutorial from scratch.

    The solution I found that seems to work is to modify the "application/configs/application.ini" file and remove the following line from the [production] section.

    includePaths.library = APPLICATION_PATH "/../library"

    Don't know what else will break by doing this, but so far it works...

  239. 239 Sangam Lama

    Ok, great tutorial. I went through it to its entirety. However, I ran into an odd issue as soon as I started to try it out.

    http://localhost/zf-tutorial/public page doesn't show the "welcome to the zend framework!" page on mine. Instead, a displays a page with the following content.

    ------------------------------------------
    Index of /student-model/public

    Parent Directory
    index.php

    ------------------------------------------
    reminder, its a step long before you even start writing any codes. Whoever helps me figure this out becomes a god for me. thank you.

  240. 240 Rob...

    Sangam,

    In Apache's httpd.conf add:

    DirectoryIndex index.html index.php
    

    Then restart Apache.

    Regards,

    Rob...

  241. 241 Sangam Lama

    Thanks for the quick response Rob. I did what you'd suggested. But now, contrary to my last post, http://localhost/zf-tutorial/public doesn't show anything at all (just a blank page). Do you think I'm still lacking some sort of a configuration step?

  242. 242 Rob...

    Sangam,

    Read your Apache error log file... It will probably tell you what the problem is.

    Regards,

    Rob...

  243. 243 Sangam Lama

    Hey Rob,

    below is the snippet of the error log relevant to the action of interest. I DO have index.php on the specified folder even though it says it can't locate it....
    ------------------------------------------
    [Tue Oct 06 19:21:08 2009] [error] [client 127.0.0.1] PHP Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\zf-tutorial\\public\\index.php on line 18
    [Tue Oct 06 19:21:08 2009] [error] [client 127.0.0.1] PHP Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php' (include_path='C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\zf-tutorial\\library;.;C:\\php5\\pear') in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\zf-tutorial\\public\\index.php on line 18
    [Tue Oct 06 19:21:08 2009] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
    [Tue Oct 06 19:21:11 2009] [error] [client 127.0.0.1] PHP Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\zf-tutorial\\public\\index.php on line 18
    [Tue Oct 06 19:21:11 2009] [error] [client 127.0.0.1] PHP Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php' (include_path='C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\zf-tutorial\\library;.;C:\\php5\\pear') in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\zf-tutorial\\public\\index.php on line 18
    [Tue Oct 06 19:21:12 2009] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
    [Tue Oct 06 19:21:13 2009] [error] [client 127.0.0.1] PHP Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\zf-tutorial\\public\\index.php on line 18
    [Tue Oct 06 19:21:13 2009] [error] [client 127.0.0.1] PHP Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php' (include_path='C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\zf-tutorial\\library;.;C:\\php5\\pear') in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\zf-tutorial\\public\\index.php on line 18
    [Tue Oct 06 19:21:13 2009] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico

  244. 244 Outsourcing Zend Framework

    Hi,

    I am using IIS 6.0 Where can find the Rewrite URL FIle (Apache's httpd.conf).

    Dan

  245. 245 Yujin

    Dan, you need apache for for using .htaccess file or you need to install some custom software for iis to work with .htaccess

  246. 246 jjsanders

    I am running xampp on windows xp. I was working on this tutorial and when i got to page 13 of the pdf version it crashed. I cant see anything weird in my error.log nor in my access log.

    I am running on windows xp xampp

  247. 247 Andrew Havens

    I'm using ZF version 1.9.3 Patch 1 with your tutorial but I am running into some issues. I was able to set up the CLI just fine on Mac OS 10.5, so thanks for that because I was having trouble getting it set up right. I skipped ahead and ran "zf create action add index" and it worked just fine.

    Then, I realized that the Zend Framework wasn't copied into the library directory and thus, wasn't doing anything when I opened it in the browser. Now after copying ZF into library, and running "zf create action edit index" I'm getting this error:

    PHP Fatal error: Cannot redeclare class Zend_Loader in /Users/andrew/Sites/zf-tutorial/library/Zend/Loader.php on line 31

    Fatal error: Cannot redeclare class Zend_Loader in /Users/andrew/Sites/zf-tutorial/library/Zend/Loader.php on line 31

  248. 248 Rob...

    jjsanders,

    Can you send me the output of phpinfo()?

    Regards,

    Rob...

  249. 249 Pranjali

    Its Really very much good tutorial for Beginner.

  250. 250 Magnus von Bromsen

    @Andrew Havens

    I ran into the same problem and someone told me to comment out "includePaths.library = APPLICATION_PATH "/../library"" in application.ini.

    Put a semicolon before the text. That worked for me - but I don't know if it will affect anything else in the future. So far so good.

  251. 251 Anonymous

    [...] [...]

  252. 252 Christopher Werby

    Hi Rob,

    Excellent tutorial, thank you!

    I'm stuck just after page 12 where I'm trying to list albums. I'm getting a fatal application error: "The mysql driver is not currently installed". Other PHP scripts (non-Zend Framework) that are on the same web server (different virtual hosts but same php.ini file) can access MySQL without difficulty. PHPInfo() says that mysql is present. It's not a typo error because I get the same message on the download version of the tutorial. Obviously, since no one else has mentioned it, this is something unique to my set-up (Mac OS X Leopard, PHP 5.2.10, ZF 1.9.2). I'm don't even know where to look!

    Thanks!

  253. 253 Rob...

    Christopher,

    You need the PDO driver installed.

    http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-6-snow-leopard/

    http://akrabat.com/php/some-notes-on-zend-server-ce-for-mac-os-x/

    http://akrabat.com/php/setting-up-php-on-os-x-leopard/

    Regards,

    Rob...

  254. 254 jjsanders

    have you had time to look into my erlier issue?
    It looks like it crashes when fetching data from the db.

  255. 255 Andrew Havens

    I think you have a typo in the source code of your PDF. At the bottom of page 9, resources.layout.layoutpath I think is supposed to be camel cased: layoutPath. I wasn't able to get my layout to apply until I changed this.

    Thanks for your tutorial. I bought your book. It was just what I needed. Thanks!

  256. 256 Dica: Tutorial para iniciantes em Zend Framework | Blog do Beraldo

    [...] Getting Started With Zend Framework [...]

  257. 257 Christopher Werby

    Thank you for pointing out the solution to my missing PDO driver, Rob -- I didn't know that there was something required other than the standard PHP install and the Zend Framework. Your instructions on installing the driver were very helpful, but with the numerous versions of PHP that I have installed on my Mac, I decided to wimp out and use MAMP rather than continue to roll my own. Can't say I'm sorry -- I was able to get a complete system running and complete your tutorial (and found it very helpful!)

    One interesting gotcha: in your Form_Album class, you show how to use the setAttrib to set an ID. As I experimented beyond the tutorial -- I wanted that "yes or no" form to be constructed as a form class similar to your Form_Album class -- I used the setAttrib method to set the 'value' attribute of a number of Form elements. This worked fine until I tried it on a hidden form element. I couldn't figure out why the value kept rendering in the form as an empty string. Turns out that 'value' should be set with the setValue method rather than setAttrib.

    Now I'm off to try to figure out how to eliminate the /index/ segment of the URLs in your album application. I bet there's some way to insert a default controller when it's omitted -- and I'm guessing that it's set in the bootstrap somehow. (I also want to get phpunit up and running.) Wish me luck! :)

  258. 258 naser

    hi
    nice tutorial and easy to understand

    i'v started zend with this article

  259. 259 apaunganhote

    I didn't find any database file inside the tutorial zip package ? Where can i get it ? Coz I got this error now

    Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zf-tutorial.albums' doesn't exist

  260. 260 Rob...

    apaunganhote,

    Schema is in the PDF.

    Regards,

    Rob..

  261. 261 apaunganhote

    Thank you so much Rob. Really appreciate it :)

  262. 262 Zend Tutorial? Kann mir jemand helfen? - Coders Talk @ tutorials.de: Forum, Tutorial, Anleitung, Schulung & Hilfe

    [...] [...]

  263. 263 Jeff Lloyd

    Thanks Rob for this tutorial. I bought your book earlier in the year but found it difficult to get into. This tutorial explains in nice easy to understand way, and now I'll be able to tackle the book again!

  264. 264 Inga

    Hi Rob,
    thank you for tutorial!

    can you help me with the problem: when I type in the command line: zf show version, it's giving me error: "php.exe" is not recognized as an internal or external command, operable program or batch file.
    what is this supposed to mean?

    thanks!

    IH

  265. 265 David Mintz

    @Inga

    This means php.exe is either not installed anywhere in your filesystem, or is somewhere that isn't in your Windows environment PATH variable.

    ZF users should be forewarned that some knowledge of this kind of technical stuff is prerequisite.

  266. 266 Inga

    2David

    Yeah, php.exe wasn't in path variable.
    I am not ZF user.
    Not yet...

  267. 267 Quim

    Hello

    i have this problem, can you help me?

    Message: Invalid controller specified (zf_tutorial_160)
    Stack trace:

    #0 C:\xampp\htdocs\Zend\zf_tutorial_160\library\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #1 C:\xampp\htdocs\Zend\zf_tutorial_160\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
    #2 C:\xampp\htdocs\Zend\zf_tutorial_160\library\Zend\Application.php(358): Zend_Application_Bootstrap_Bootstrap->run()
    #3 C:\xampp\htdocs\Zend\zf_tutorial_160\public\index.php(27): Zend_Application->run()
    #4 {main}

    Request Parameters:

    array(4) {
    ["controller"]=>
    string(15) "zf_tutorial_160"
    ["action"]=>
    string(5) "index"
    ["edit"]=>
    string(2) "id"
    ["module"]=>
    string(7) "default"
    }

    the configuration of apache in Windows are:

    Alias /zf_tutorial_160 "C:/xampp/htdocs/Zend/zf_tutorial_160/public"

    DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all

  268. 268 Quim

    Me contesto yo mismo:

    Solucionado en .htaccess:

    /zf_tutorial_160/

  269. 269 yafa

    Hi, this is great and amazing, I really loved it. but I have question how can I create form that deals with two different tables in the database like client and their services form I want to fill the clients information and in the same submitting action adding the services they have just requested?

    any help

  270. 270 Jamie

    This tutorial has a few things wrong. Following step for step will not work. :) LOL why would I buy your book.

  271. 271 Rob...

    Jamie,

    Could you be specific in which particular steps didn't work for you?

    Thanks,

    Rob...

  272. 272 Simon

    I still can't understand why I can't get it to work eventhough I had been troubleshooting for the whole night and I realised, I am working on a windows platform. The directory divider is "\". But Zend had it all mixed up with "/" and "\". Could it be the reason why it is not loading? I can't even get pass loading the bootstrap

    fopen(./views\helpers/Doctype.php) [function.fopen]: failed to open stream: No such file or directory
    fopen(./views\helpers/HeadMeta.php) [function.fopen]: failed to open stream: No such file or directory
    fopen(./views\helpers/HeadTitle.php) [function.fopen]: failed to open stream: No such file or directory

  273. 273 sasikumar

    Uncaught exception 'Zend_Auth_Adapter_Exception' in /home/www/htdocs/testing/sasi/zend_auth/library/Zend/Auth/Adapter/DbTable.php:350 Stack trace: #0 /home/www/htdocs/testing/sasi/zend_auth/library/Zend/Auth/Adapter/DbTable.php(304): Zend_Auth_Adapter_DbTable->_authenticateSetup() #1 /home/www/htdocs/testing/sasi/zend_auth/library/Zend/Auth.php(117): Zend_Auth_Adapter_DbTable->authenticate() #2 /home/www/htdocs/testing/sasi/zend_auth/application/controllers/AuthController.php(43): Zend_Auth->authenticate(Object(Zend_Auth_Adapter_DbTable)) #3 /home/www/htdocs/testing/sasi/zend_auth/library/Zend/Controller/Action.php(513): AuthController->loginAction() #4 /home/www/htdocs/testing/sasi/zend_auth/library/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('loginAction') #5 /home/www/htdocs/testing/sasi/zend_auth/library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #6 /home/www/h in /home/www/htdocs/testing/sasi/zend_auth/library/Zend/Auth/Adapter/DbTable.php on line 350

    Whem i am trying zend auth following errors occured what is the solutions pls any body tell me

  274. 274 junior

    Andrew Havens at #247 and Magnus von Bromsen at #250,

    Your comments saved me hours. Thank you.

  275. 275 Steph

    Hello,
    Thank you for this great tutorial. All is working great except a little thing for me.
    First I am working behind a proxy apache server.
    Here is the situation for "mysite": the proxy on serverA redirect the address http://mysite.mydom.fr to http://ipserverB/mysite.
    My problem is that the url() method always includes the root directory "mysite" when I use it in 'views/scripts/index/index.phtml'.

    Here is an example of a working link for my site:
    http://mysite.mydom.fr/app/zf-tutorial/public/index/edit/id/1
    The link made by $this->url(array('controller'=>'index', 'action'=>'edit', 'id'=>$album->id)): http://mysite.mydom.fr/mysite/app/zf-tutorial/public/index/edit/id/1

    I tried several ways: modify the baseUrl of the front controller, but I think I am wrong as the controller is working great. I tried to change the RewriteBase of the .htaccess, and add some route without success.

    The only way I found to make it work is to use str_replace('/mysite',''... but not very usefull ;-)

    So is there any way to tell the url() method to take a specific path ?
    Or is there any other way to solve my problem? As I am a beginner, I certainly missed something ;-)

    Thanks for your help

    Best regards

  276. 276 Rob...

    Steph,

    I'd use something like $request->setBaseUrl('/'); from a front controller plugin's preDispatch() hook.

    Regards,

    Rob...

  277. 277 Steph

    Thank you very much ! I better read the sequence globale :-)

  278. 278 Harald

    Thank You for the tutorial that helped me (zf_newbie) a lot.
    One suggestion to make it "complete": Could you consider adding some lines for handling the Exception ("Could not find row $id") = howto show a custom error 404 page?
    I've been now googling for hours on this topic and getting more confused then informed?

    $_USER['KNOWLEDGE_STATUS'] == ZF_NEWBIE;

  279. 279 Rey

    An error occurred!
    message ?>
    etc etc....

    1) I checked application.ini:
    resources.db.adapter = "PDO_MYSQL"
    resources.db.params.host = "localhost"
    resources.db.params.dbname = "scott"
    resources.db.params.username = "root"
    resources.db.params.password = "xxxx"
    resources.db.isDefaultTableAdapter = true

    2) I checked the php.ini
    [PHP_MYSQL]
    extension=php_mysql.dll
    extension=php_pdo.dll
    extension=php_pdo_mysql.dll

    3) I downloaded and put 2 dll's in the ext directory:
    php_pdo.dll
    php_pdo_mysql.dll

    I am using ZendTool 1.8 and php 5.041

    Help, cause I am stuck!

  280. 280 Rey

    Hi,
    I also get:

    Not Found

    The requested URL /zf-tutorial_160/public/index/add was not found on this server.
    and
    The requested URL /zf-tutorial_160/public/index/delete was not found on this server.
    and
    The requested URL /zf-tutorial_160/public/index/edit was not found on this server.

    (I downloaded the 'zf-tutorial-160.zip')...
    Help appreciated

  281. 281 Rey

    I installed PHP 5.2.11 and now it works...

  282. 282 Rob...

    Rey,

    Glad you sorted it!
    The #279 issue is that you need short open tags enabled.

    Rob..

  283. 283 mueni

    Excellent tutorial. Works great except for the very last part, the delete part. Not sure what I'm doing wrong but when I click the Delete link on any album I get the correct page but two things are wrong:

    The confirmation text doesn't display the name of the album or the artist, instead it says:

    Are you sure you want to delete '' by ''?

    Second thing is pressing Yes doesn't delete the album and pressing No does nothing, it stays on the confirmation page. Not sure what I'm doing wrong. Here's my deleteAction code:

    ---

    $this->view->title = "Delete Album";
    $this->view->headTitle($this->view->title, 'PREPEND');

    if ($this->getRequest()->isPost()){
    $del = $this->getRequest()->getPost('del');
    if ($del == 'Yes') {
    $id = $this->getRequest()->getPost('id');
    $albums = new Model_DbTable_Albums();
    $albums->deleteAlbum($id);

    $this->_redirect('/');
    } else {
    $id = $this->_getParam('id',0);
    $albums = new Model_DbTable_Albums();
    $form->view->album = $albums->getAlbum($id);

    ---

    and my delete.phtml code

    --

    Are you sure you want to delete
    'escape($this->album['title']); ?>' by
    'escape($this->album['artist']);?>'?

    <form action="url(array('action'=>'delete')); ?>" method="post" />

    <input type="hidden" name="id" value="album['id']; ?>" />

    ---

    Why is this not working?

    thanks
    mueni

  284. 284 mueni

    Hmm, somehow the last two lines of my delete.phtml code got chopped out of my comment.

    Are you sure you want to delete
    'escape($this->album['title']); ?>' by
    'escape($this->album['artist']);?>'?

    <form action="url(array('action'=>'delete')); ?>" method="post" />

    < input type="hidden" name="id" value="album['id']; ?>" />

  285. 285 mueni

    Arghh, suffice it to say my code is exactly identical to the tutorial. I hope someone can help.

    thanks!

  286. 286 kb

    The title is not displayed in the layout. The head title works though...

    layout.phtml:
    escape($this->title); ?>
    layout()->content ?>

    controller:
    $this->view->title = "Albums";

    index.phtml:
    escape($this->title); ?>

    result:

    Albums
    ... content

    any fixes for this problem??

  287. 287 kb

    hmm, my comments got chopped also... anyway, this->title is not working in layout.

  288. 288 iqbal

    Hai all,
    i get error whe i try to view:http://zendproject/

    My Albums
    An error occurred
    Application error
    Exception information:

    Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zend.model_dbtable_albums' doesn't exist
    Stack trace:

    #0 G:\xampp\htdocs\ZendProject\library\Zend\Db\Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
    #1 G:\xampp\htdocs\ZendProject\library\Zend\Db\Adapter\Abstract.php(468): Zend_Db_Statement->execute(Array)
    #2 G:\xampp\htdocs\ZendProject\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('DESCRIBE `Model...', Array)
    #3 G:\xampp\htdocs\ZendProject\library\Zend\Db\Adapter\Pdo\Mysql.php(156): Zend_Db_Adapter_Pdo_Abstract->query('DESCRIBE `Model...')
    #4 G:\xampp\htdocs\ZendProject\library\Zend\Db\Table\Abstract.php(823): Zend_Db_Adapter_Pdo_Mysql->describeTable('Model_DbTable_A...', NULL)
    #5 G:\xampp\htdocs\ZendProject\library\Zend\Db\Table\Abstract.php(866): Zend_Db_Table_Abstract->_setupMetadata()
    #6 G:\xampp\htdocs\ZendProject\library\Zend\Db\Table\Abstract.php(973): Zend_Db_Table_Abstract->_setupPrimaryKey()
    #7 G:\xampp\htdocs\ZendProject\library\Zend\Db\Table\Select.php(100): Zend_Db_Table_Abstract->info()
    #8 G:\xampp\htdocs\ZendProject\library\Zend\Db\Table\Select.php(78): Zend_Db_Table_Select->setTable(Object(Model_DbTable_Albums))
    #9 G:\xampp\htdocs\ZendProject\library\Zend\Db\Table\Abstract.php(1009): Zend_Db_Table_Select->__construct(Object(Model_DbTable_Albums))
    #10 G:\xampp\htdocs\ZendProject\library\Zend\Db\Table\Abstract.php(1307): Zend_Db_Table_Abstract->select()
    #11 G:\xampp\htdocs\ZendProject\application\controllers\IndexController.php(17): Zend_Db_Table_Abstract->fetchAll()
    #12 G:\xampp\htdocs\ZendProject\library\Zend\Controller\Action.php(513): IndexController->indexAction()
    #13 G:\xampp\htdocs\ZendProject\library\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('indexAction')
    #14 G:\xampp\htdocs\ZendProject\library\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #15 G:\xampp\htdocs\ZendProject\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
    #16 G:\xampp\htdocs\ZendProject\library\Zend\Application.php(358): Zend_Application_Bootstrap_Bootstrap->run()
    #17 G:\xampp\htdocs\ZendProject\public\index.php(26): Zend_Application->run()
    #18 {main}

    Request Parameters:

    array (
    'controller' => 'index',
    'action' => 'index',
    'module' => 'default',
    )

    databasename is: zend
    tablename is: albums
    I'm using username/password: i4ba1/abc123

    can anyone help me please...? Thanks!

  289. 289 Rob...

    iqbal,

    In your class Model_Dbtable_Albums, you need to specify the database table name using the protected $_name property:

    
    class Model_Dbtable_Albums {
        protected $_name 'albums';
    
        // class continues
    }
    
    

    Regards,

    Rob...

  290. 290 TimJ

    Greetings & thanks for this tutorial. I have gotten as far as the "Common HTML code: Layouts" section and can't get it working. I get the following error on the first line of the _initViewHelpers method:

    Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Resource matching "layout" not found' in /home/sitename/zend.sitename.net/library/Zend/Application/Bootstrap/BootstrapAbstract.php:687

    I followed the suggestion of a previous poster to add the following lines to the application.ini:
    resources.layout.layout = "layout"
    resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"

    After doing that, I now get this error:

    Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Unable to resolve plugin "layouts"; no corresponding plugin with that name' in /home/sitename/zend.sitename.net/library/Zend/Application/Bootstrap/BootstrapAbstract.php:330

    Any help would be greatly appreciated! -Tim

  291. 291 iqbal

    Thank you rob for your answer now my code is working. but why the variable to store table name is $_name??. if i replace again into $name i get error Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zend.model_dbtable_albums' doesn't exist.

  292. 292 Rob...

    TimJ,

    Which version of ZF are you using?

    iqbal,

    All private & protected properties in Zend Framework start with an underscore.

    Regards,

    Rob...

  293. 293 iqbal

    i use zend framework 1.9. so the in zend framework is that all private and protected variable must be prefix with underscore??

  294. 294 TimJ

    Rob,
    I'm using 1.9.5

    Thanks
    Tim

  295. 295 TimJ

    Hi Rob,
    Looks like I solved my own problem. I didn't follow your tutorial correctly and had a typo in application.ini:

    resources.layouts.layoutPath = APPLICATION_PATH "/layouts"

    should have been

    resources.layout.layoutPath = APPLICATION_PATH "/layouts"

    I hope you didn't waste time with it! Thanks

  296. 296 pegas

    the tutorial works until you get to the layout part. After that nothing.

  297. 297 Rob...

    pegas,

    Can you provide more information? Does the zip file download work?

    Regards,

    Rob...

  298. 298 smita

    i got error
    Exception information:

    Message: Invalid controller specified (sasmita)
    Stack trace:

    #0 /xyz/library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #1 /xyz/library/Zend/Application/Bootstrap/Bootstrap.php(77): Zend_Controller_Front->dispatch()
    #2 /xyz/library/Zend/Application.php(358): Zend_Application_Bootstrap_Bootstrap->run()
    #3 /xyz/public/index.php(25): Zend_Application->run()
    #4 {main}

    Request Parameters:

    array (
    'controller' => 'smita',
    'action' => 'smita',
    'public' => 'index',
    'edit' => 'id',
    'module' => 'default',
    )

    same code works locally perfect but in remote server it give error.

    nybody can help

  299. 299 wheresrhys » Blog Archive » A greasy framework

    [...] care of the tricky bits for them. It took ages to get past this stumbling block, with the help of this tutorial (WARNING: The bit on connecting to the database either uses quotes when it shouldn't or vice [...]

  300. 300 smita

    I am not host it directly in remote server i created a folder then the zend folder .Is it the cause of giving error as base url ll b diff.

  301. 301 smita

    I solve my problem,
    I've just define the path in application.ini :
    resources.frontController.baseUrl = "/folder/zf"

    Thanks rob for your wonderful tutorial.Its helpful for beginners.

  302. 302 Rob...

    smita,

    Glad you sorted it.

    Regards,

    Rob...

  303. 303 Michael Stelly

    Rob,
    Same problem as post #186.
    terminal output:
    Zend Framework Version: 1.9.6
    ---------
    zf create action add index
    An Error Has Occurred
    A project profile was not found.

    Zend Framework Command Line Console Tool v1.9.6
    Details for action "Create" and provider "Action"
    Action
    zf create action name controller-name[=index] view-included[=1] module
    -------
    I'm also using Zend Studio 7.1. This is all new to me so I have no idea what this message means.

  304. 304 Oliver

    I was getting the message "Fatal error: Class 'Models_DbTable_Albums' ..."
    And the problem was I had a wrong name in one of my folders.

    Wrong way:
    application\models\DbTables

    Right way:
    application\models\DbTable

    singular form is the correct

  305. 305 Chibz

    Hi Rob,

    Thanks for all your very helpful tutorials. The tutorials pushed me to get a copy of your book which I now have in my hands.

    Can you help me this this problem please. I have been trying to use view helpers and I found that when I use a view helper, I lose the title in the layout. This is the same problem as 'kb' reported here.

    The title is not displayed in the layout. The head title works!!

    layout.phtml:
    escape($this->title); ?>
    layout()->content ?>

    controller/action:
    $this->view->title = "My Albums";

    Please can you help as this is doing my head in!!!!

  306. 306 Rob...

    Chibz,

    Does the source code download work for you?

    Regards,

    Rob...

  307. 307 Chibz

    Hi Rob,

    Yes the source code download works ok. However, I've been playing with resource plugins in your tutorial -- http://akrabat.com/php/initial-notes-on-zend_application/.

    I found what's causing the problem. If I comment out the 'parent::init' from the view helper file, it works. I don't yet understand why though?
    ________________________
    library/Admin/Application/Resource/View.php
    getView();
    $view->doctype('XHTML1_STRICT');
    $view->headTitle()->setSeparator(' - ');
    Zend_Layout::startMvc(APPLICATION_PATH . '/views/layouts');

    }
    }

  308. 308 Chibz

    Some of the code got chopped off for some reason.

    I'll try again:
    __________________
    class Admin_Application_Resource_View extends Zend_Application_Resource_View
    {
    public function init()
    {
    //** parent::init(); **/
    $view = $this->getView();
    $view->doctype('XHTML1_STRICT');
    $view->headTitle()->setSeparator(' - ');
    Zend_Layout::startMvc(APPLICATION_PATH . '/views/layouts');

    }
    }

  309. 309 vladi

    i have this problem when i call
    $rows = $images->fetchAll(); in my ImageController, my config look like this
    [production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    phpSettings.date.timezone = "UTC"
    includePaths.library = APPLICATION_PATH "/../library"
    bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
    bootstrap.class = "Bootstrap"
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    resources.layout.layoutpath = APPLICATION_PATH "/layouts"
    resources.db.adapter = PDO_MYSQL
    resources.db.params.host = localhost
    resources.db.params.username = root
    resources.db.params.password = 123456
    resources.db.params.dbname = portal
    everything worked just fine until i wanted to get my data from db... it shows error - 'Invalid controller specified (error)'

  310. 310 vladi

    my table:
    class Model_DbTable_Images extends Zend_Db_Table_Abstract {
    protected $_name = 'images';
    }
    i have a table images in my db(portal) with two fields - id(auto increment,int11) and name. Before $rows = $images->fetchAll(); there is $images = new Model_DbTable_Images(); and without $rows = $images->fetchAll(); it gives no error. What am i doing wrong.. thanks

  311. 311 Nitin khotwiale

    Hello

    Thanks for all your very helpful tutorials.
    its working properly.
    I have created new form called RegistrationForm.php on application/forms folder and I have called it on RegistrationController like

    class RegistrationController extends Zend_Controller_Action
    {
    function registrationAction()
    {
    $form = new RegistrationForm(); $this->view->form = $form;

    but I have facing error Class 'Registration_Form' not found

    So, can you please give me any solutions about it.

    Please help me

    Thanks
    Nitin

  312. 312 index aufbau - wie macht man es richtig? - php.de

    [...] Ich denke, dieses Tutorial ist ein ganz guter Einblick, was so state of the art bei den gängigeren Frameworks ist: Akra’s DevNotes - Tutorial: Getting Started with Zend Framework 1.9 [...]

  313. 313 Zend Framework – mega zestawienie : W drodze ku szczęściu

    [...] http://akrabat.com/zend-framework-tutorial/ [...]

  314. 314 Prskavčí blog » Zend_Rest_Route a Zend_Rest_Controller v ZF 1.9

    [...] jsem základní tutorial z akrabatu a modifikoval jsem ho pro použití s REST. Zdrojové kódy jsou k dispozici na [...]

  315. 315 Ametris

    Hi,

    Can I quote the $data in insert() method?
    How?

  316. 316 Ametris

    Hi,

    When Insert or Edit data with "à" final character receive this error:
    SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xC3' for column 'title' at row 1

  317. 317 Bill

    Rob,

    THANK YOU FOR THIS!!

    I just spent the whole night trying to figure out why i was getting 404 errors with URLs structured like "locahost/controller/action" and hadn't seen the AllowOverride directive addressed until now.

    If I ever make it to the UK I will personally shake your hand!

    Warmest Regards,
    Bill S

  318. 318 Big thanks and Happy New Year

    [...] most importantly, Rob Allen for his excellent blog posts in general, and more specifically "Getting Started with Zend Framework" guide which he keeps updated very [...]

  319. 319 Matt

    I'm having a cache problem. I completed the demo, and the CRUD works, except that the index page is not updating for a few minutes after an action.

    Adding a new entry does not appear for a while. Deleted entries persist to appear for a while.

    Does zend have db cache settings somewhere?

  320. 320 seraphim

    Hi Rob,

    Thank you for this great tutorial. Had some difficulties on my opensuse 11.2 system to get it work but at last it worked. Found out that mod_env must be enabled in the apache2 environment which was not at default. And in /etc/apache2/default-server.conf I had to change both AllowOverride None and Options None in AllowOverride All and Options All. Hope someone can use this.

  321. 321 Zend_Session_SaveHandler_DbTable doen’t work » Xrigher

    [...] later, I create a totally new blank project following the Quick Start of ZF & Tutorial: Getting Started with Zend Framework 1.9, it [...]

  322. 322 Zend Framework (>=1.8) Step By Step » Xrigher

    [...] quick start: zend.com / akrabat.com [...]

  323. 323 SpAwN_gUy

    hi, i've met some difficulties with Zend Bootstrap, but reading these comments i've figured something out, so i'm just posting the results, might me someone would find this useful.

    okay, due to some reason (lost in time) we've renamed our bootstrap index.php to main.php :)

    and allways used the "previous" .htaccess file
    this one:
    -------------
    RewriteEngine on
    RewriteBase /
    RewriteRule !\.(js|gif|jpg|png|css|ico|bmp|swf)$ main.php
    php_flag magic_quotes_gpc off
    -------------

    but now all Zend docs recommend to use the "new" one:
    -------------
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ main.php [NC,L]
    php_flag magic_quotes_gpc off
    -------------
    notice main.php ..
    well, the second one is not(was not) working giving Apache's "Forbidden. you don't have permission to access / on the server".

    but, reading these comments solution is:
    adding to httpd.conf under VirtualHost
    DirectoryIndex main.php

    'cause initial statement was just:
    DirectoryIndex index.html
    and then (modified and worked fine with "previous .htaccess")
    DirectoryIndex index.html index.php

    regards. btw, thanks for the tutorial i was reading it a year ago, when i just started with Zend.. and php itself :)

  324. 324 屋顶上的轻骑兵 - zend tool win xp下配置使用

    [...] tool不能",仅能"1.8.x的,原版教程在这里http://akrabat.com/zend-framework-tutorial/,按提示"作了很多回,可以执行zf show version,但是create [...]

  325. 325 Robi

    Hi Rob,
    I need some help please, at first i try to do by tutorial

    I set in httpd.conf

    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    #

    AllowOverride all

    if i write zf show version
    i get Zend Framework Version: 1.9.5

    work OK

    zf create project zf-tutorial

    create me a project, work OK

    http://localhost/zf-tutorial/public/ working, i see welcome to the,... OK

    then i write in cmd
    zf create action add index

    C:\Program Files\Zend\Apache2\htdocs\zf-tutorial>zf create action add index

    PHP Fatal error: Cannot redeclare class Zend_Loader in C:\Program Files\Zend\Ap
    ache2\htdocs\zf-tutorial\library\Zend\Loader.php on line 31

    Fatal error: Cannot redeclare class Zend_Loader in C:\Program Files\Zend\Apache2
    \htdocs\zf-tutorial\library\Zend\Loader.php on line 31

    what is wrong?

    When i test your associated code, it works OK. I create my database, set password,... and it work all delete, edit, add

  326. 326 Rob...

    Robi,

    Do you have a copy of ZF already on your php include path?

    Regards,

    Rob...

  327. 327 Francis Drouillard

    Hello Rob -- Thank you for the excellent and extremely helpful tutorial, Rob.

    I'm using Zend Server CE 4.0.6 with PHP 5.3.0 on an iMac running Mac OS X 10.6.2.

    Zend Server CE is running with all the installation defaults with one exception -- apache is listening to port 80 instead of 10088.

    The ZendFramework-1.9.7 folder was copied to /usr/local/ZendFrameworkCli as described for ZendFramework-1.9.0.

    An alias was added. Typing "zf show version" from Terminal in any directory yields the desired results.

    Zend_Tool was used successfully to create the project "zf-tutorial" in the document root at:

    /usr/local/zend/apache2/htppd

    to achieve the file and directory structure shown on page 3 of the tutorial.

    phpMyAdmin works, as did the web pages:

    http://localhost/
    http://localhost/zf-tutorial/public/
    http://localhost/zf-tutorial/public/index/add
    http://localhost/zf-tutorial/public/index/edit
    http://localhost/zf-tutorial/public/index/delete

    The database "zf-tutorial" with table "albums" containing 5 records was achieved with phpMyAdmin the table creation and insert records scripts. The database has been accessed and browsed by two distinct users, one with a password, the other without.

    An "Albums.php" file was created in the directory specified on page 8, as were several more files per the pages that followed.

    Visiting http://localhost/zf-tutorial/public/ on my machine now yields the following error message:

    My Albums

    An error occurred

    Application error

    Exception information:

    Message: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    Stack trace:

    #0 /usr/local/zend/share/ZendFramework/library/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
    #1 /usr/local/zend/share/ZendFramework/library/Zend/Db/Adapter/Abstract.php(448): Zend_Db_Adapter_Pdo_Mysql->_connect()
    #2 /usr/local/zend/share/ZendFramework/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('DESCRIBE `album...', Array)
    #3 /usr/local/zend/share/ZendFramework/library/Zend/Db/Adapter/Pdo/Mysql.php(156): Zend_Db_Adapter_Pdo_Abstract->query('DESCRIBE `album...')
    #4 /usr/local/zend/share/ZendFramework/library/Zend/Db/Table/Abstract.php(823): Zend_Db_Adapter_Pdo_Mysql->describeTable('albums', NULL)
    #5 /usr/local/zend/share/ZendFramework/library/Zend/Db/Table/Abstract.php(866): Zend_Db_Table_Abstract->_setupMetadata()
    #6 /usr/local/zend/share/ZendFramework/library/Zend/Db/Table/Abstract.php(973): Zend_Db_Table_Abstract->_setupPrimaryKey()
    #7 /usr/local/zend/share/ZendFramework/library/Zend/Db/Table/Select.php(100): Zend_Db_Table_Abstract->info()
    #8 /usr/local/zend/share/ZendFramework/library/Zend/Db/Table/Select.php(78): Zend_Db_Table_Select->setTable(Object(Model_DbTable_Albums))
    #9 /usr/local/zend/share/ZendFramework/library/Zend/Db/Table/Abstract.php(1009): Zend_Db_Table_Select->__construct(Object(Model_DbTable_Albums))
    #10 /usr/local/zend/share/ZendFramework/library/Zend/Db/Table/Abstract.php(1307): Zend_Db_Table_Abstract->select()
    #11 /usr/local/zend/apache2/htdocs/zf-tutorial/application/controllers/IndexController.php(17): Zend_Db_Table_Abstract->fetchAll()
    #12 /usr/local/zend/share/ZendFramework/library/Zend/Controller/Action.php(513): IndexController->indexAction()
    #13 /usr/local/zend/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('indexAction')
    #14 /usr/local/zend/share/ZendFramework/library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #15 /usr/local/zend/share/ZendFramework/library/Zend/Application/Bootstrap/Bootstrap.php(77): Zend_Controller_Front->dispatch()
    #16 /usr/local/zend/share/ZendFramework/library/Zend/Application.php(358): Zend_Application_Bootstrap_Bootstrap->run()
    #17 /usr/local/zend/apache2/htdocs/zf-tutorial/public/index.php(26): Zend_Application->run()
    #18 {main}
    Request Parameters:

    array (
    'controller' => 'index',
    'action' => 'index',
    'module' => 'default',
    )

    Going over the previous 325 comments helped a bit, but I still can't connect to MySQL.

    Any ideas?

    Thanks!

    Frank

  328. 328 Francis Drouillard

    Rob -- The links in comment 253 no longer work (blank pages). -- Frank

  329. 329 Rob...

    Francis,

    Thanks for noticing! I've updated.

    Regards,

    Rob...

  330. 330 Francis Drouillard

    Rob -- No problem! Any ideas why I can't connect to my MySQL database? (Comment #327.) If not, any ideas where I can dig to find out for myself? Thanks! -- Frank

  331. 331 Bryan Christiansen

    I just completed the tutorial and everything worked except for the edit.phtml. Here is the code for edit.phtml:

    form ;?>

    When I change this to just it displays hi so the page is displaying but it will not call the function I have set in IndexController for some reason. Here is the code I have in IndexController:

    public function editAction()
    {
    // action body
    function editAction()
    {
    $this->view->title = "Edit album";
    $this->view->headTitle($this->view->title, 'PREPEND');

    $form = new Form_Album();
    $form->submit->setLabel('Save');
    $this->view->form = $form;

    if ($this->getRequest()->isPost()) {
    $formData = $this->getRequest()->getPost();
    if ($form->isValid($formData)) {
    $id = (int)$form->getValue('id');
    $artist = $form->getValue('artist');
    $title = $form->getValue('title');
    $albums = new Model_DbTable_Albums();
    $albums->updateAlbum($id, $artist, $title);

    $this->_redirect('/');
    } else {
    $form->populate($formData);
    }
    } else {
    $id = $this->_getParam('id', 0);
    if ($id > 0) {
    $albums = new Model_DbTable_Albums();
    $form->populate($albums->getAlbum($id));
    }
    }
    }
    }

    What can I do to get the edit.phtml file to display propertly? Thank you in advance and thank you for such a great tutorial. If you need any more information please let me know and I will post whatever you need. Also what is the next tutorial I should do in order to learn Zend better?

  332. 332 Bryan Christiansen

    sorry the above comment messed up a little in edit.phtml the code is:

    "form ;?>"

  333. 333 Zend Framework Tutorials » Pacific-Design.com - Search Engines Development by Kevin Duraj

    [...] http://akrabat.com/zend-framework-tutorial/ Posted in PHP Development Cancel [...]

  334. 334 Robi

    in path i have

    %systemroot%\system32;
    %systemroot%;
    %systemroot%\system32\wbem;
    c:\program files\ibm\gsk8\lib;
    C:\PROGRA~1\IBM\SQLLIB\BIN;
    C:\PROGRA~1\IBM\SQLLIB\FUNCTION;
    C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;
    C:\Program Files\Zend\Core\bin;
    C:\Program Files\MySQL\MySQL Server 5.0\bin;
    C:\Program Files\ZendFrameworkCli\bin

    this is not working for zf create action add index

    then i try to copy zf.bat,zf.php into C:\Program Files\Zend\Core\bin
    not working,

    zf show version
    zf create project project_name
    working OK

  335. 335 Marc

    I have been using a working, standard modules set up for a while, and am just now wanting to add a 'forms' directory to each of my modules.

    In my 'admin' module I simply add a 'forms' directory at the same levels as 'controllers', then I use:

    $form = new Admin_Form_Someform();

    to reach the class Admin_Form_Someform

    which resides at admin/forms/Someform.php

    I know shades of this have been addressed, but I'm pulling my hair out as to why this won't work.

    Seems so simple. Can't get default module forms to work either.

    Any help would be much appreciated.

  336. 336 Marc

    Forgot to enter the error I'm getting:
    Fatal error: Class 'Admin_Form_Addform' not found in /Applications/MAMP/htdocs/zendscheduler.com/application/modules/admin/controllers/IndexController.php

  337. 337 Rob...

    Marc,

    Add a Bootstrap.php file to application/modules/admin/:

    
    class Bootstrap extends Zend_Application_Module_Bootstrap
    {
    }
    
    

    Regards,

    Rob...

  338. 338 Marc

    Rob,

    Thanks for the reply. I've discovered that I can get everything to work with 3 Bootstraps.

    1. At the application root:
    class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {}

    2. In the 'default' module:
    class Default_Bootstrap extends Zend_Application_Module_Bootstrap {}

    3. In the 'admin' module:
    class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {}

    The only unexpected behavior is that the class for forms in my default module must include the Default prefix:
    class Default_Form_Addform { }

    and so must the instantiation, of course:
    $form = new Default_Form_Addform

    If those are missing, the forms cannot be found in the Default namespace. It's only a minor inconvenience to include the prefix, but I'm wondering if that can be avoided. Controllers do not require the prefix.

    Marc

  339. 339 hadi

    Hi Rob,
    Thank's for the great tutorial.
    I have problem with "zf create action"
    when i use it for example "zf create action delete index"
    in result show this :

    Creating an action named delete inside controller at C:\apache\htdocs\zf-tutorial/application/controllers/indexController.php
    Updating project profile 'C:\apache\htdocs\zf-tutorial/.zfproject.xml'
    Creating a view script for the delete action method at C:\apache\htdocs\zf-tutorial/application/views/scripts/about/delete.phtml
    Updating project profile 'C:\apache\htdocs\zf-tutorial/.zfproject.xml'

    but after navigating
    http://localhost/zf-tutorial/public/index/edit
    i see 404 error

    please guide me

    Thanks

  340. 340 Rob...

    hadi,

    You haven't read the bit in red at the top of this page.

    Regards,

    Rob...

  341. 341 hadi

    thank's for your reply

  342. 342 Gary

    Rob,
    I believe I have done all the requirements, however even with AllowOverride All set in http.conf ( AllowOverride All) and have enabled the mod_rewrite extension (LoadModule rewrite_module modules/mod_rewrite.so). I am still getting a 404 error on add, edit, and delete. I am using the community Zend Server 4.0.6 with PHP 5.2 & Apache 2.2.14 on Windows 7. I am using Virtual Host, if that makes a difference.
    Any Help will be most appreciated.

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.