2009-02-24 09:17:56 +02:00
|
|
|
<?php defined('SYSPATH') or die('No direct script access.');
|
2009-03-21 00:01:47 +02:00
|
|
|
/**
|
|
|
|
* Controller class.
|
|
|
|
*
|
|
|
|
* @package Kohana
|
|
|
|
* @author Kohana Team
|
|
|
|
* @copyright (c) 2008-2009 Kohana Team
|
|
|
|
* @license http://kohanaphp.com/license.html
|
|
|
|
*/
|
2009-02-24 09:17:56 +02:00
|
|
|
abstract class Controller_Core {
|
|
|
|
|
2009-03-21 00:01:47 +02:00
|
|
|
/**
|
|
|
|
* @var object Request that created the controller
|
|
|
|
*/
|
2009-03-01 15:44:27 +02:00
|
|
|
public $request;
|
2009-02-24 09:17:56 +02:00
|
|
|
|
2009-03-21 00:01:47 +02:00
|
|
|
/**
|
|
|
|
* Creates a new controller instance. Each controller must be constructed
|
|
|
|
* with the request object that created it.
|
|
|
|
*
|
|
|
|
* @param object Request that created the controller
|
|
|
|
* @return void
|
|
|
|
*/
|
2009-02-24 09:17:56 +02:00
|
|
|
public function __construct(Request $request)
|
|
|
|
{
|
2009-03-21 00:01:47 +02:00
|
|
|
// Assign the request to the controller
|
2009-02-24 09:17:56 +02:00
|
|
|
$this->request = $request;
|
|
|
|
}
|
|
|
|
|
2009-03-21 00:01:47 +02:00
|
|
|
/**
|
|
|
|
* Automatically executed before the controller action.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2009-05-02 00:46:39 +03:00
|
|
|
public function before()
|
2009-02-24 09:17:56 +02:00
|
|
|
{
|
2009-03-21 00:01:47 +02:00
|
|
|
// Nothing by default
|
2009-02-24 09:17:56 +02:00
|
|
|
}
|
|
|
|
|
2009-03-21 00:01:47 +02:00
|
|
|
/**
|
|
|
|
* Automatically executed after the controller action.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2009-05-02 00:46:39 +03:00
|
|
|
public function after()
|
2009-02-24 09:17:56 +02:00
|
|
|
{
|
2009-03-21 00:01:47 +02:00
|
|
|
// Nothing by default
|
2009-02-24 09:17:56 +02:00
|
|
|
}
|
|
|
|
|
2009-03-02 02:06:44 +02:00
|
|
|
} // End Controller
|