Hi,
I have an error in the bootstrap file when I load the my modules :
Service 'Apps\Frontend\Module' wasn't found in the dependency injection container
I'm using the multi modules architecture like this :
multiple/
├── common
│ ├── config
│ │ ├── config.php
│ │ ├── modules.php
│ │ └── services.php
│ ├── library
│ │ └── Elements.php
│ │ └── Tools.php
│ │ └── PhpMailer.php
│ ├── models
│ │ └── User.php
├── apps
│ ├── frontend
│ │ ├── Module.php
│ │ ├── controllers
│ │ │ ├── ControllerBase.php
│ │ │ └── IndexController.php
│ │ ├── plugins
│ │ │ └── SecurityPlugin.php
│ │ │ └── NotFoundPlugin.php
│ │ ├── cache
│ │ │ └── cache1.php
│ │ │ └── cache2.php
│ │ └── views
│ │ ├── index
│ │ │ └── index.phtml
│ │ └── index.phtml
│ │
│ └── api
│ ├── controllers
│ │ └── RestController.php
│ └── Module.php
│
├── .htaccess
├── index.html
└── public
└── index.php
└── .htaccess
And here is the way how I load my modules in the bootstrap file :
/**
* Read the configuration
*/
$config = include __DIR__ . "/../common/config/config.php";
/**
* Read auto-loader
*/
include __DIR__ . "/../common/config/loader.php";
/**
* Read services
*/
include __DIR__ . "/../common/config/services.php";
/**
* Handle the request
*/
$application = new \Phalcon\Mvc\Application($di);
$application->registerModules(
array(
'frontend' => array(
'className' => 'Apps\Frontend\Module',
'path' => '../apps/frontend/Module.php',
),
'api' => array(
'className' => 'Apps\Api\Module',
'path' => '../apps/api/Module.php',
)
)
);
echo $application->handle()->getContent();
\Phalcon\Mvc\Model::setup([ 'notNullValidations' => false ]);
Could you help me ?
Thanks.