From 41d608c378e64fcf0c31325f470713f2281f8596 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 19 Feb 2013 09:02:35 +0100 Subject: [PATCH] refactor Tpex call using init function instead of multiple setters --- core/lib/Thelia/Core/Template/Parser.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Parser.php b/core/lib/Thelia/Core/Template/Parser.php index cd5a9f652..1350f1d39 100644 --- a/core/lib/Thelia/Core/Template/Parser.php +++ b/core/lib/Thelia/Core/Template/Parser.php @@ -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(); }