diff options
Diffstat (limited to 'system/libraries/Controller.php')
| -rw-r--r-- | system/libraries/Controller.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php new file mode 100644 index 0000000..a1139f6 --- /dev/null +++ b/system/libraries/Controller.php @@ -0,0 +1,44 @@ +<?php defined('SYSPATH') OR die('No direct access allowed.'); +/** + * Kohana Controller class. The controller class must be extended to work + * properly, so this class is defined as abstract. + * + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ +abstract class Controller_Core { + + // Allow all controllers to run in production by default + const ALLOW_PRODUCTION = TRUE; + + /** + * Loads URI, and Input into this controller. + * + * @return void + */ + public function __construct() + { + if (Kohana::$instance == NULL) + { + // Set the instance to the first controller loaded + Kohana::$instance = $this; + } + } + + /** + * Handles methods that do not exist. + * + * @param string method name + * @param array arguments + * @return void + */ + public function __call($method, $args) + { + // Default to showing a 404 page + Event::run('system.404'); + } + +} // End Controller Class
\ No newline at end of file |
