We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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 ?



11.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.