Reputation: 141
Is there a way to have base bootstrap and module bootstrap?
this is my app structure
- application
- modules
- admin
- controllers
- Bootstrap.php
- public
- controllers
- Bootstrap.php
- Bootstrap.php
- libraries
When I test my app only the base bootstrap is executed. I forced the execution of the modules bootstrap with this (in the base bootstrap):
$modules = array('admin', 'public');
foreach ($modules as $module) {
$path = APP_PATH . '/modules/' . $module . '/Bootstrap.php';
$class = ucfirst($module) . '_Bootstrap.php';
include_once $path;
$bootstrap = new $class($this);
$bootstrap->bootstrap();
}
Only with this I can execute bootstrap of modules. Is there another way?
Upvotes: 0
Views: 191
Reputation: 33148
The module resource runs the module bootstraps. This is triggered by the presence of:
resources.modules[] = ""
in your application.ini
, or you can manually bootstrap the modules in your main bootstrap class as you have.
Upvotes: 1