Get loading working
This commit is contained in:
parent
8906a63e8e
commit
c08b7a3a23
|
@ -14,7 +14,7 @@ abstract class Kohana_Kostache {
|
|||
|
||||
const VERSION = '4.0.0';
|
||||
|
||||
public static function engine()
|
||||
public static function engine($template_name)
|
||||
{
|
||||
$m = new Mustache_Engine(
|
||||
array(
|
||||
|
@ -25,5 +25,7 @@ abstract class Kohana_Kostache {
|
|||
},
|
||||
)
|
||||
);
|
||||
|
||||
return $m->loadTemplate($template_name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
class Mustache_Loader_Kohana implements Mustache_Loader
|
||||
{
|
||||
private $_base_dir = 'templates';
|
||||
private $_extension = '.mustache';
|
||||
private $_extension = 'mustache';
|
||||
private $_templates = array();
|
||||
|
||||
public function construct($base_dir = NULL, $options = array())
|
||||
public function __construct($base_dir = NULL, $options = array())
|
||||
{
|
||||
if ($base_dir)
|
||||
$this->_base_dir = $base_dir;
|
||||
|
||||
if (isset($options['extension']))
|
||||
|
@ -26,8 +27,9 @@ class Mustache_Loader_Kohana implements Mustache_Loader
|
|||
return $this->_templates[$name];
|
||||
}
|
||||
|
||||
protected function load_file($name)
|
||||
protected function _load_file($name)
|
||||
{
|
||||
$filename = Kohana::find_file($this->_base_dir, $name, $this->_extension);
|
||||
return file_get_contents($filename);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue