each module is available in the container with name module.ModuleName
This commit is contained in:
@@ -33,8 +33,10 @@ namespace Thelia\Core;
|
||||
*/
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use Symfony\Component\Validator\Tests\Fixtures\Reference;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
|
||||
@@ -107,6 +109,16 @@ class Thelia extends Kernel
|
||||
foreach ($modules as $module) {
|
||||
|
||||
try {
|
||||
|
||||
$defintion = new Definition();
|
||||
$defintion->setClass($module->getCode() ."\\". ucfirst($module->getCode()));
|
||||
$defintion->addMethodCall("setContainer", array('service_container'));
|
||||
|
||||
$container->setDefinition(
|
||||
"module.".$module->getCode(),
|
||||
$defintion
|
||||
);
|
||||
|
||||
$loader = new XmlFileLoader($container, new FileLocator(THELIA_MODULE_DIR . "/" . ucfirst($module->getCode()) . "/Config"));
|
||||
$loader->load("config.xml");
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
|
||||
Reference in New Issue
Block a user