Zend Framework QuickStart Tutorial: What are the filenames?
November 13th, 2008
I’ve just worked my way through the Tutorial for the PHP Zend Framework. I overlooked downloading the code at the start and launched straight into it creating each piece myself from the tutorial.
After the first couple of pages they (currently) neglect to mention where each piece of code is supposed to go. Maybe I learnt a lot more, but it did not make for a very ‘quick’ start trying to work out where things go from the error messages.
Here’s the final structure of the QuickStart Tutorial…
application/
|-- app.ini
|-- bootstrap.php
|-- controllers
| |-- ErrorController.php
| |-- GuestbookController.php
| `-- IndexController.php
|-- forms
| `-- GuestBook.php
|-- layouts
| `-- scripts
| `-- layout.phtml
|-- models
| |-- DbTable
| | `-- GuestBook.php
| `-- GuestBook.php
`-- views
`-- scripts
|-- error
| `-- error.phtml
|-- guestbook
| |-- index.phtml
| `-- sign.phtml
`-- index
`-- index.phtml
John is a freelance programmer living in Sydney Australia. He blogs whatever takes his fancy; computing tips, travel letters, and random stuff from his life. He does it primarily to learn and demonstrate the running of a website.
Thanks, that’s really useful. Have spent most of the day trying to get through the Zend Framework QuickStart tutorial, and your post explains a lot that the (intentionally?) vague tutorial doesn’t. If they’d had something like this in there (or even made the effort to explain where each piece of code went, radical though that may be!) I think a lot more people wouldn’t be put off ZF at the first hurdle!
I too, spent a considerable amount of time on this tutorial. And I did the same thing in copying the snippets of code and pasting them into an editor, and then saving them into their appropriate directory with the correct file name. The location and file names I used were derived from the code snippets themselves,,at the top of each.
However, I could not get it to work. You pointed me down the correct path referring to the .htaccess file.
I made your suggested changes and still had the trouble. Then I realized my virtual servers AllowOverride directive was set to “none”. ooops. After making a few changes and viewing my log files I realized my Apache had not loaded the rewrite module.A few more changes and voila !!
The above structure is correct except, instead of:
application/
|– app.ini
it is like:
application/
|– config
| |– app.ini