/** * Class constructor * * @param array $defaults Defaults to merge for urlFor() * @param null|Horde_Route_Utils $utils Route utilities */ public function __construct($defaults = array(), $utils = null) { $this->_defaults = $defaults; if ($utils === null) { $utils = Mad_Controller_Dispatcher::getInstance()->getRouteUtils(); } $this->_utils = $utils; }
<?php require_once dirname(dirname(__FILE__)) . '/config/environment.php'; $dispatcher = Mad_Controller_Dispatcher::getInstance(); $dispatcher->dispatch();
/** * Print out all defined routes in match order, with names. */ public function routes() { $dispatcher = Mad_Controller_Dispatcher::getInstance(); $mapper = $dispatcher->getRouteMapper(); $mapper->utils->printRoutes(); }
/** * Get the controller & process the request */ protected function _recognizeRoutes() { try { $this->controller = Mad_Controller_Dispatcher::getInstance()->recognize($this->request); $this->_recognized = true; } catch (Mad_Controller_Exception $e) { $this->_recognized = false; } }