kostache/classes/kohana/kostache/layout.php
2011-02-24 18:34:41 -05:00

32 lines
588 B
PHP

<?php defined('SYSPATH') or die('No direct script access.');
abstract class Kohana_Kostache_Layout extends Kostache {
/**
* @var string partial name for content
*/
const CONTENT_PARTIAL = 'content';
/**
* @var string layout path
*/
protected $_layout = 'layout';
public function render()
{
if ( ! $this->_layout)
{
return parent::render();
}
$partials = $this->_partials;
$partials[Kostache_Layout::CONTENT_PARTIAL] = $this->_template;
$template = $this->_load($this->_layout);
return $this->_stash($template, $this, $partials)->render();
}
}