refactor Tpex call using init function instead of multiple setters
This commit is contained in:
@@ -60,6 +60,10 @@ class Parser implements ParserInterface
|
|||||||
protected $content;
|
protected $content;
|
||||||
protected $status = 200;
|
protected $status = 200;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @var Thelia\Tpex\Tpex
|
||||||
|
*/
|
||||||
protected $tpex;
|
protected $tpex;
|
||||||
|
|
||||||
protected $template = "default";
|
protected $template = "default";
|
||||||
@@ -169,9 +173,7 @@ class Parser implements ParserInterface
|
|||||||
{
|
{
|
||||||
$content = $this->openFile($this->getRequest());
|
$content = $this->openFile($this->getRequest());
|
||||||
|
|
||||||
$this->tpex->setContent($content);
|
$this->tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
|
||||||
$this->tpex->setDispatcher($this->container->get("dispatcher"));
|
|
||||||
$this->tpex->setRequest($this->container->get("request"));
|
|
||||||
|
|
||||||
$this->tpex->execute();
|
$this->tpex->execute();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user