refactor Tpex call using init function instead of multiple setters

This commit is contained in:
Manuel Raynaud
2013-02-19 09:02:35 +01:00
parent 3a79577260
commit 41d608c378

View File

@@ -60,6 +60,10 @@ class Parser implements ParserInterface
protected $content;
protected $status = 200;
/**
*
* @var Thelia\Tpex\Tpex
*/
protected $tpex;
protected $template = "default";
@@ -169,9 +173,7 @@ class Parser implements ParserInterface
{
$content = $this->openFile($this->getRequest());
$this->tpex->setContent($content);
$this->tpex->setDispatcher($this->container->get("dispatcher"));
$this->tpex->setRequest($this->container->get("request"));
$this->tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
$this->tpex->execute();
}