On 1 May 2009, at 12:54, Matthew Weier O'Phinney wrote:

In my application/modules/default/Bootstrap.php:

class Default_Bootstrap extends Zend_Application_Module_Bootstrap
{
  public function run()
  {
      echo "Default Bootstrap!
";
  }
}

run() in module bootstraps is never called; only the run() in the main
application bootstrap will ever be called. If you want to test that a
module bootstrap is indeed being instantiated and invoked, override the
constructor:

  public function __construct($application)
  {
      parent::__construct($application);
      echo "Bootstrap loaded!";
  }


Hi,

I've found that this works, but not for the default module. Bootstraps for other modules are loaded fine, it seems that the Bootstrap for the default module isn't instantiated?

I've partly got around this by manually setting the autoloader in my main app bootstrap:

   public function _initAutoloaderForDefaultModule()
   {
       $this->bootstrap('frontController');
       $defaultModulePath = $this->frontController->getModuleDirectory(
           $this->frontController->getDefaultModule()
       );
       $autoloader = new Zend_Application_Module_Autoloader(array(
           'namespace' => 'Default',
           'basePath'  => $defaultModulePath
       ));
   }

Cheers,

Tim.

Reply via email to