It sounds good to load modules as you need.
Right now for simplicity, I just created a section in config.ini for modules
and then added some code to my bootstrap to take that information and
automatically set the controllers and models for each module.
Currently, I do the following:
--- In config.ini ---
;;; modules ;;;
; paths are relative to the 'application' directory
modules.default.controllers.directory = "controllers"
modules.default.models.directory = "models"
modules.event.controllers.directory = "modules/event/controllers"
modules.event.models.directory = "modules/event/models"
--- In bootstrap ---
$router = $frontController->getRouter(); // returns a rewrite router by
default
$aControllers = array();
// building associative array from config for module controller paths and
adding models to the include path
foreach ($config->modules as $tmpName => $oConf) {
$aControllers[$tmpName] = $app_path . $oConf->controllers->directory;
set_include_path('.' . PATH_SEPARATOR . $app_path .
$oConf->models->directory . PATH_SEPARATOR . get_include_path());
}
$frontController->setControllerDirectory($aControllers);
$registry->set('controllers', $aControllers); // add it to the registry
--
View this message in context:
http://www.nabble.com/Model-Loading-helper-tf3942096s16154.html#a11326850
Sent from the Zend Framework mailing list archive at Nabble.com.