Home >Backend Development >PHP Tutorial >Phalcon multi-module configuration problem

Phalcon multi-module configuration problem

WBOY
WBOYOriginal
2016-08-04 09:22:171316browse

The official manual has the following code to register multiple modules

<code>// 注册模块
$application->registerModules(
    array(
        'frontend' => array(
            'className' => 'Multiple\Frontend\Module',
            'path'      => '../apps/frontend/Module.php',
        ),
        'backend'  => array(
            'className' => 'Multiple\Backend\Module',
            'path'      => '../apps/backend/Module.php',
        )
    )
);</code>

Where 'className' => 'MultipleFrontendModule', what does it mean? According to the official file configuration, the following is always displayed:

'MultipleFrontendModule' wasn't found in the dependency injection container

Reply content:

The official manual has the following code to register multiple modules

<code>// 注册模块
$application->registerModules(
    array(
        'frontend' => array(
            'className' => 'Multiple\Frontend\Module',
            'path'      => '../apps/frontend/Module.php',
        ),
        'backend'  => array(
            'className' => 'Multiple\Backend\Module',
            'path'      => '../apps/backend/Module.php',
        )
    )
);</code>

Where 'className' => 'MultipleFrontendModule', what does it mean? According to the official file configuration, the following is always displayed:

'MultipleFrontendModule' wasn't found in the dependency injection container

  1. Does the file apps/frontend/Module.php exist and the path is correct

  2. In this file, is there a class named Module?

  3. Whether the namespace of this class is
  4. MutipleFrontend

  5. Let’s check them one by one (slip
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn