Jara Base – a base Zend Framework app

6 Responses January 21st, 2009 | Ekerete.

I recently had to set up a Zend Framework project at a friend’s house and realized how reliant I am on Zend Studio to set up a fresh project. Meet Jara Base – the ZF starter app and my solution to this minor issue. It’s essentially a slightly modified version of the Zend Studio project structure with the following variations/additions:

  • Added a test helper to the tests folder.
  • Added a static route plugin for handling static site pages.

Usage

Adding static pages

Most applications have pages for static content e.g. an about page, a contact page, etc. I prefer my static pages without the controller name and the ‘page’ route removes the need to add the controller name to the url. Jara Base already includes an about page with a corresponding view and this page is accessed with ‘http://www.example.com/about’ rather than ‘http://www.example.com/index/about’.

To add a static page, add an action to the ‘Index’ controller of the ‘Default’ module. Add a corresponding view and the page will be available at ‘http://www.example.com/:action’.
Static routes with the same name as your controller actions are created by default.
To disable static routes, comment out (or delete) the static routes line in the plugins section of the application config file (application.ini).

6 Responses to “Jara Base – a base Zend Framework app”

  1. Wil Sinclair Says:

    We hope to really nail this issue with 1.8. Our RAD tools like Zend_Tool will generate a default project structure that is recommended by the ZF team. Of course, it will also work with a custom project structure. :)

    ,Wil

  2. Eric Marden Says:

    I had to add this to Initializer.php on lines 15 – 18 to get jara base app to work out of the box:


    ini_set('include_path',
    ini_get('include_path') .
    PATH_SEPARATOR . APP_ROOT . '/library'
    );

    This assumes you added the framework to /library/Zend

  3. Ekerete Says:

    @Eric, My bad. Thanks for the heads-up.

    I have the Zend Framework files in my include path and the Initializer class assumed the files would always be available.

    It’s fixed now! I have added the Zend Framework files (version 1.7.6) to the library folder and reworked the bootstrap process to set up the include paths before loading the Initializer class.

  4. call of duty 7 Says:

    Compatibility

  5. Andrea Goldstone Says:

    Great info on site, I will add to favorites be checking for updates.

  6. free ebooks Says:

    thanks pro!

Leave a Reply