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

@ -7,6 +7,11 @@ class Controller_Template_Core extends Controller {
*/ */
public $template = 'template'; public $template = 'template';
/**
* @var bool auto render template
**/
public $auto_render = TRUE;
/** /**
* Loads the template View object. * Loads the template View object.
* *
@ -24,9 +29,18 @@ class Controller_Template_Core extends Controller {
* @return void * @return void
*/ */
public function after() public function after()
{
if ($this->auto_render === TRUE)
{ {
// Assigns the template as the request response // Assigns the template as the request response
$this->request->response = $this->template; $this->request->response = $this->template;
} }
else
{
// Nothing to render here.
$this->request->reposnse = '';
}
}
} // End Controller_Template } // End Controller_Template