/** * Use this method to build the container with the services that you need. */ protected function buildContainer(ContainerBuilder $container) { /** @var Request $request */ $request = $container->get("request"); if (null === $request->getSession()) { $request->setSession(new Session()); } $container->set("thelia.parser.forms", ["thelia.empty" => "Thelia\\Form\\EmptyForm", "thelia.empty.2" => "Thelia\\Form\\EmptyForm", "thelia.api.empty" => "Thelia\\Form\\Api\\ApiEmptyForm"]); $container->set("thelia.form_factory_builder", (new FormFactoryBuilder())->addExtension(new CoreExtension())); $container->set("thelia.forms.validator_builder", new ValidatorBuilder()); $container->set("thelia.form_factory", new TheliaFormFactory($request, $container, $container->get("thelia.parser.forms"))); $container->set("thelia.parser.context", new ParserContext($request, $container->get("thelia.form_factory"), new TheliaFormValidator(new Translator($container), 'dev'))); $this->smarty = new SmartyParser($request, $container->get("event_dispatcher"), $container->get("thelia.parser.context"), $templateHelper = new TheliaTemplateHelper()); $container->set("thelia.parser", $this->smarty); $this->smarty->addPlugins($this->getPlugin($container)); $this->smarty->registerPlugins(); }