implements Phalcon\Di\InjectionAwareInterface
Phalcon\Cli\Router is the standard framework router. Routing is the process of taking a command-line arguments and decomposing it into parameters to determine which module, task, and action of that task should receive the request
$router = new \Phalcon\Cli\Router(); $router->handle(array( 'module' => 'main', 'task' => 'videos', 'action' => 'process' )); echo $router->getTaskName();
Phalcon\Cli\Router constructor
Sets the dependency injector
Returns the internal dependency injector
Sets the name of the default module
Sets the default controller name
Sets the default action name
Sets an array of default paths. If a route is missing a path the router will use the defined here This method must not be used to set a 404 route
$router->setDefaults(array( 'module' => 'common', 'action' => 'index' ));
Handles routing information received from command-line arguments
Adds a route to the router
$router->add('/about', 'About::main');
Returns proccesed module name
Returns proccesed task name
Returns processed action name
Returns processed extra params
Returns the route that matches the handled URI
Returns the sub expressions in the regular expression matched
Checks if the router matches any of the defined routes
Returns all the routes defined in the router
Returns a route object by its id
Returns a route object by its name
© 2011–2016 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/latest/api/Phalcon_Cli_Router.html