From 7d92e96c7ea8264488d06bd1b449162763de70b3 Mon Sep 17 00:00:00 2001 From: Robert Krause Date: Thu, 13 Feb 2014 10:53:09 +0100 Subject: [PATCH] fixes codeguy/Slim-Views#18 --- Smarty.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Smarty.php b/Smarty.php index 8593cec..4f530a6 100644 --- a/Smarty.php +++ b/Smarty.php @@ -67,6 +67,11 @@ class Smarty extends \Slim\View * @var SmartyExtensions The Smarty extensions directory you want to load plugins from */ public $parserExtensions = array(); + + /** + * @var mixed A valid Smarty template directory definition. + */ + public $smartyTemplatesDirectory = 'templates'; /** * @var parserInstance persistent instance of the Parser object. @@ -107,7 +112,7 @@ public function getInstance() } $this->parserInstance = new \Smarty(); - $this->parserInstance->template_dir = $this->getTemplatesDirectory(); + $this->parserInstance->template_dir = is_null($this->smartyTemplatesDirectory) ? $this->getTemplatesDirectory() : $this->smartyTemplatesDirectory; if ($this->parserExtensions) { $this->parserInstance->addPluginsDir($this->parserExtensions); }