Jara Base – a base Zend Framework app
Wednesday, January 21st, 2009I 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
- Download and unzip Jara Base (either from GitHub or from here).
- Copy to the library files to the root of your application.
- Set up your virtual host and make the ‘public’ folder the web root (the first part of this post shows how).
- Enjoy!
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).

