Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Smarty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}
Expand Down