Throw Kohana_Exception when Mustache template file not found

This commit is contained in:
Ando Roots 2012-12-30 19:30:30 +02:00
parent d144462a32
commit 74841f65ac

View file

@ -30,6 +30,12 @@ class Mustache_Loader_Kohana implements Mustache_Loader, Mustache_Loader_Mutable
protected function _load_file($name)
{
$filename = Kohana::find_file($this->_base_dir, $name, $this->_extension);
if ( ! $filename)
{
throw new Kohana_Exception('Mustache template ":name" not found', array(':name' => $name));
}
return file_get_contents($filename);
}