Last active
August 29, 2015 14:00
-
-
Save phalcon/11298335 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Phalcon\Mvc; | |
/** | |
* Phalcon\Mvc\Dispatcher | |
* | |
* Dispatching is the process of taking the request object, extracting the module name, | |
* controller name, action name, and optional parameters contained in it, and then | |
* instantiating a controller and calling an action of that controller. | |
* | |
*<code> | |
* | |
* $di = new \Phalcon\Di(); | |
* | |
* $dispatcher = new \Phalcon\Mvc\Dispatcher(); | |
* | |
* $dispatcher->setDI($di); | |
* | |
* $dispatcher->setControllerName('posts'); | |
* $dispatcher->setActionName('index'); | |
* $dispatcher->setParams(array()); | |
* | |
* $controller = $dispatcher->dispatch(); | |
* | |
*</code> | |
*/ | |
class Dispatcher extends \Phalcon\Dispatcher implements \Phalcon\Mvc\DispatcherInterface | |
{ | |
protected _handlerSuffix = "Controller"; | |
protected _defaultHandler = "index"; | |
protected _defaultAction = "index"; | |
/** | |
* Sets the default controller suffix | |
* | |
* @param string controllerSuffix | |
*/ | |
public function setControllerSuffix(string! controllerSuffix) | |
{ | |
let this->_handlerSuffix = controllerSuffix; | |
} | |
/** | |
* Sets the default controller name | |
* | |
* @param string controllerName | |
*/ | |
public function setDefaultController(string! controllerName) | |
{ | |
let this->_defaultHandler = controllerName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment