This commit is contained in:
Manuel Raynaud
2013-03-13 19:51:07 +01:00
parent 27900374bf
commit 3a415d1123
5 changed files with 84 additions and 59 deletions

View File

@@ -69,11 +69,9 @@ class TheliaBundle extends Bundle
$container->register('resolver', 'Symfony\Component\HttpKernel\Controller\ControllerResolver');
$container->register('tpex', 'Thelia\Tpex\Tpex');
$container->register('parser','Thelia\Core\Template\Parser')
->addArgument(new Reference('service_container'))
->addArgument(new Reference('tpex'))
;
/**
* RouterListener implements EventSubscriberInterface and listen for kernel.request event

View File

@@ -75,10 +75,9 @@ class Parser implements ParserInterface
*
* public function __construct(ContainerBuilder $container)
*/
public function __construct(ContainerInterface $container, Tpex $tpex)
public function __construct(ContainerInterface $container)
{
$this->container = $container;
$this->tpex = $tpex;
}
/**
@@ -148,16 +147,18 @@ class Parser implements ParserInterface
public function loadParser()
{
$content = $this->openFile($this->getRequest());
$this->tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
$this->tpex->configure(
$tpex = new Tpex();
$tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
$tpex->configure(
array(),
array(),
array(
"secure" => "Thelia\Core\Template\BaseParam\Secure"
)
);
$this->setContent($this->tpex->execute());
$this->setContent($tpex->execute());
}
protected function openFile(Request $request)