diff --git a/Views/Smarty.php b/Views/Smarty.php index 38f9f26..5f47547 100644 --- a/Views/Smarty.php +++ b/Views/Smarty.php @@ -88,7 +88,7 @@ class Smarty extends \Slim\View public function render($template) { $instance = self::getInstance(); - $instance->assign($this->data); + $instance->assign($this->data->all()); return $instance->fetch($template); } @@ -107,7 +107,9 @@ public static function getInstance() } require_once self::$smartyDirectory . '/Smarty.class.php'; self::$smartyInstance = new \Smarty(); - self::$smartyInstance->template_dir = is_null(self::$smartyTemplatesDirectory) ? $this->getTemplatesDirectory() : self::$smartyTemplatesDirectory; + if (self::$smartyTemplatesDirectory) { + self::$smartyInstance->template_dir = self::$smartyTemplatesDirectory; + } if (self::$smartyExtensions) { self::$smartyInstance->addPluginsDir(self::$smartyExtensions); }