I’m going to use my own skeleton project, zf2skeleton, but if you prefer you can also use ZendSkeletonApplication, the only difference is that I use my own module, named «Empirio», but on ZendSkeletonApplication the main module is named «Application». Also the ZendModuleApplication uses Twitter bootstrap as layout.

You start by downloading the skeleton application into a folder, in my case im going to use git, so I just run this command from my terminal:

git clone git://github.com/oxodesign/zf2skeleton.git

And then I will use composer.phar to install my dependencies (in this case, zend framework 2 beta 5).

php composer.phar install

The composer will also set up the autoloader for you. And that’s all you have to do, now you have a working application using zf2. The structure on your application now looks something like this:

config
    autoload
        global.php
    application.config.php
data
    cache
module
    Empirio
public
    index.php
    .htaccess
    web.config
vendor
    zendframework
        zendframework
init_autoloader.php
composer.phar
composer.json
…

Inside config-folder you have the «application.config.php»-file where you can state your configuration, ex. what modules you are going to use, module paths and so on. The data folder is self-explained, the module folder is where you put your zend framework modules (will write a blog post on how to create a module from scratch), inside public folder you have the index.php-file which is the starting point for your application, also under this folder you put your media files such css, images and javascript-files. On vendor folder you have third-party dependencies (libraries), such as ZF2, Doctrine and so on.