Adding auto rendering for the template controller.

Signed-off-by: Woody Gilk <woody.gilk@kohanaphp.com>
This commit is contained in:
ThePixelDeveloper 2009-06-17 23:38:18 +08:00 committed by Woody Gilk
parent 3ba7ade7cf
commit 10ad0e3f5a

View file

@ -6,6 +6,11 @@ class Controller_Template_Core extends Controller {
* @var string page template
*/
public $template = 'template';
/**
* @var bool auto render template
**/
public $auto_render = TRUE;
/**
* Loads the template View object.
@ -25,8 +30,17 @@ class Controller_Template_Core extends Controller {
*/
public function after()
{
// Assigns the template as the request response
$this->request->response = $this->template;
if ($this->auto_render === TRUE)
{
// Assigns the template as the request response
$this->request->response = $this->template;
}
else
{
// Nothing to render here.
$this->request->reposnse = '';
}
}
} // End Controller_Template