/** * Add Module * * @param Module $module * @return Container * @throws \LogicException */ public function addModule(Module $module) { $name = $module->getName(); if (isset($this->modules[$name])) { throw new \LogicException(sprintf('Trying to register two modules with the same name "%s"', $name)); } $this->view->addTemplatePath($module->getPath() . '/Resources/views'); $this->modules[$name] = $module; return $this; }