Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Router getDefaultModule missing

Hello, why function getDefaultModule has been removed from 2.0 if method setDefaultModule is still in ? Or is similiar function to in router ?



6.2k
Accepted
answer
edited May '15

Ok I have found the solution,

$defaults = $router->getDefaults();
$module = $defaults['module'];

Indeed getDefaultModule is missing from Phalcon\Mvc\Router, but is still in Phalcon\Mvc\Application; if you setDefaultModule in router you can't get it from Application. It might have been forgotten during rewriting to zephir. You can submit a bug report.