Layout view should use a default template location if none is provided

This commit is contained in:
Caspar 2010-08-09 22:46:08 +08:00 committed by Jeremy Bush
parent bbc0bb9140
commit d3105bc261

View file

@ -14,6 +14,14 @@ class View_Kohana_Layout extends Kostache
*/
public function render($template = null, $view = null, $partials = null)
{
// Override the template location to match kohana's conventions
if ( ! $this->_template)
{
$foo = explode('_', get_class($this));
array_shift($foo);
$this->_template = strtolower(implode('/', $foo));
}
$this->_partials+=array(
'body' => $this->_template
);
@ -24,4 +32,4 @@ class View_Kohana_Layout extends Kostache
return parent::render($template, $view, $partials);
}
} // End View_Layout
} // End View_Layout