0

有没有办法让基础引导和模块引导?

这是我的应用程序结构

- application
  - modules
    - admin
      - controllers
      - Bootstrap.php
    - public
      - controllers
      - Bootstrap.php
  - Bootstrap.php
- libraries

当我测试我的应用程序时,仅执行基本引导程序。我用这个(在基本引导程序中)强制执行模块引导程序:

$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();
}

只有这样我才能执行模块的引导。还有其他方法吗?

4

1 回答 1

1

模块资源运行模块引导程序。这是由以下情况触发的:

resources.modules[] = ""

在你的application.ini, 或者你可以手动引导你的主引导类中的模块。

于 2012-07-20T17:56:15.970 回答