Controller_Codebench
› Kohana_Controller_Template
› Controller
› Kohana_Controller
Class Contents
Constants
- None
Properties
Methods
Class declared in MODPATH/codebench/classes/controller/codebench.php on line 11.
Properties
- public
$auto_render - public
$request - public
$template
Methods
public action_index( )
› Controller_Codebench
Source Code
public function action_index($class)
{
// Convert submitted class name to URI segment
if (isset($_POST['class']))
$this->request->redirect('codebench/'.trim($_POST['class']));
// Pass the class name on to the view
$this->template->class = (string) $class;
// Try to load the class, then run it
if (Kohana::auto_load($class) === TRUE)
{
$codebench = new $class;
$this->template->codebench = $codebench->run();
}
}
public after( )
› Kohana_Controller_Template
Source Code
public function after()
{
if ($this->auto_render === TRUE)
{
$this->request->response = $this->template;
}
return parent::after();
}
public before( )
› Kohana_Controller_Template
Source Code
public function before()
{
if ($this->auto_render === TRUE)
{
// Load the template
$this->template = View::factory($this->template);
}
return parent::before();
}
public __construct( )
› Kohana_Controller
Source Code
public function __construct(Request $request)
{
// Assign the request to the controller
$this->request = $request;
}