Renaming "template" to "layout"

This commit is contained in:
Jeremy Bush 2010-07-13 21:57:07 -05:00
parent 3f283b65d5
commit 4b3b10c028
3 changed files with 10 additions and 9 deletions

View file

@ -1,14 +1,14 @@
<?php defined('SYSPATH') or die('No direct script access.');
abstract class Controller_Kostache extends Controller {
abstract class Controller_Layout extends Controller {
/**
* @var string page template
* @var string page layout
*/
public $template = 'template';
public $template = 'layout';
/**
* @var boolean auto render template
* @var boolean auto render layout
**/
public $auto_render = TRUE;
@ -19,15 +19,16 @@ abstract class Controller_Kostache extends Controller {
{
if ($this->auto_render === TRUE)
{
// Load the template
$this->template = Walrus::factory($this->template);
// Load the layout
$view_class = 'View_'.$this->template;
$this->template = new $view_class;
}
return parent::before();
}
/**
* Assigns the template [View] as the request response.
* Assigns the layout [View] as the request response.
*/
public function after()
{
@ -39,4 +40,4 @@ abstract class Controller_Kostache extends Controller {
return parent::after();
}
} // End Controller_Kostache
} // End Controller_Layout

View file

@ -1,6 +1,6 @@
<?php defined('SYSPATH') or die('No direct script access.');
class View_Template extends Kostache {
class View_Layout extends Kostache {
/**
* @var string template title