Hello Naioshi Cozmicboy!

I setup my application a little differently than you but I hope this example
helps you to get your app working.

application
- controllers (for default controllers)
-- indexController
-- accountController (for new users to register and for existing users to
login, logout, edit their account, recover password, etc.)
- models (for default models)
- modules (for your modules)
-- blog
-- events
- plugins (unused at the moment)
- views (for global templates and helpers)
-- filters
-- helpers
--- UserTimestamp.php (a nice helper that outputs the date and time based on
the users preferences / locale)
-- scripts
--- index
--- account
--- siteHeader.phtml
--- siteFooter.phtml
config.ini or config.xml

In my config file I created the following entries
;;; modules ;;;
; paths are relative to the 'application' directory
modules.default.controllers.directory = "controllers"
modules.default.models.directory      = "models"
modules.blog.controllers.directory     = "modules/blog/controllers"
modules.blog.models.directory          = "mobules/blog/models"

In my bootstrap I have the following variables:
- $library_path = /path/to/zend/library/
- $app_path = /path/to/application (usually ./application/ when relative to
bootstrap)
... add them to Zend_Registry
... setup Zend_Db, Zend_Session, Zend_Controller_Front
$aControllers = array();
// building associative array from config for paths
foreach ($config->modules as $tmpName => $oConf) {
        $aControllers[$tmpName] = $app_path . $oConf->controllers->directory; //
adding to array an entry ie. 'moduleName' => '/path/to/module'
        set_include_path('.' . PATH_SEPARATOR . $app_path .
$oConf->models->directory . PATH_SEPARATOR . get_include_path()); // adding
module's model directory to the include path
}
$frontController->setControllerDirectory($aControllers); // setting the
Controllers and their respective directories to the front controller
$registry->set('controllers', $aControllers); // add it to the registry
$frontController->dispatch(); // run!

I have much to add to my application such as Access Control Lists (Zend_ACL)
so things will get better.

I have much to learn about this framework also.
-- 
View this message in context: 
http://www.nabble.com/ZF---how-to-set-up-modular-application-tf3787511s16154.html#a10723008
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to