Posted by & filed under Uncategorized.

To make life a little easier we can add the ZFTool to our project. You can install it as a module or a standalone .phar file. In this post we will be adding it by downloading the .phar file and placing it in the root of our project’s directory. Download the file from:

https://packages.zendframework.com/zftool.phar

then copy it into the root of your project.

Screen Shot 2014-01-24 at 7.25.54 PM

Now lets take it for a test drive. Since we will be walking through the album tutorial located on the Zend Framework website, let’s use the ZFTool to create the module, controller and necessary controller actions. First, jump into a command-line interface (CLI) and change your working directory to the root of your project. From here run:

php zftool.phar create module Album
php zftool.phar create controller AlbumController Album
php zftool.phar create action add AlbumController Album
php zftool.phar create action edit AlbumController Album
php zftool.phar create action delete AlbumController Album

Now we have created the Album module, controller, and added three actions: add, edit, delete. Note that the config/application.config.php file has been updated to reflect the addition of a new module, the controller file has been created, all of the actions have been added to the controller, and all of the actions have had view files created for them as well. The Album module has been setup nicely for us to begin development.

What do you really think?