C_Router

A router is configured to match patterns against a url and route the request to a particular controller and action.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/router/package.module.router.php  
  1. class C_Router extends C_Component 
  2. static $_instances = array(); 
  3. var $_apps = array(); 
  4. var $_default_app = NULL; 
  5. function define($context = FALSE) 
  6. if (!$context or $context == 'all') { 
  7. $context = '/'; 
  8. parent::define($context); 
  9. $this->add_mixin('Mixin_Url_Manipulation'); 
  10. $this->add_mixin('Mixin_Router'); 
  11. $this->implement('I_Router'); 
  12. function initialize() 
  13. parent::initialize(); 
  14. $this->_request_method = !empty($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null; 
  15. static function &get_instance($context = False) 
  16. if (!isset(self::$_instances[$context])) { 
  17. $klass = get_class(); 
  18. self::$_instances[$context] = new $klass($context); 
  19. return self::$_instances[$context];