Adding auto rendering for the template controller.
Signed-off-by: Woody Gilk <woody.gilk@kohanaphp.com>
This commit is contained in:
parent
3ba7ade7cf
commit
10ad0e3f5a
|
@ -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.
|
||||||
*
|
*
|
||||||
|
@ -25,8 +30,17 @@ class Controller_Template_Core extends Controller {
|
||||||
*/
|
*/
|
||||||
public function after()
|
public function after()
|
||||||
{
|
{
|
||||||
// Assigns the template as the request response
|
if ($this->auto_render === TRUE)
|
||||||
$this->request->response = $this->template;
|
{
|
||||||
|
// Assigns the template as the request response
|
||||||
|
$this->request->response = $this->template;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Nothing to render here.
|
||||||
|
$this->request->reposnse = '';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End Controller_Template
|
} // End Controller_Template
|
Loading…
Reference in a new issue