diff --git a/classes/kohana/kostache.php b/classes/kohana/kostache.php index 5141c34..2cb2289 100644 --- a/classes/kohana/kostache.php +++ b/classes/kohana/kostache.php @@ -12,7 +12,7 @@ */ abstract class Kohana_Kostache { - const VERSION = '2.0.1'; + const VERSION = '2.0.2'; /** * Factory method for Kostache views. Accepts a template path and an @@ -60,8 +60,16 @@ abstract class Kohana_Kostache { { if ( ! $template) { - // Detect the template for this class - $template = $this->_detect_template(); + if ($this->_template) + { + // Load the template defined in the view + $template = $this->_template; + } + else + { + // Detect the template for this class + $template = $this->_detect_template(); + } } // Load the template @@ -103,7 +111,7 @@ abstract class Kohana_Kostache { ob_start(); // Render the exception - Kohana_Exception::text($e); + Kohana::exception_handler($e); return (string) ob_get_clean(); } @@ -215,7 +223,9 @@ abstract class Kohana_Kostache { */ protected function _stash($template, Kostache $view, array $partials) { - return new Mustache($template, $view, $partials); + return new Kohana_Mustache($template, $view, $partials, array( + 'charset' => Kohana::$charset, + )); } /** diff --git a/classes/kohana/mustache.php b/classes/kohana/mustache.php new file mode 100644 index 0000000..49ed1ec --- /dev/null +++ b/classes/kohana/mustache.php @@ -0,0 +1,3 @@ +