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

Dispatcher: Why beforeException not fired if route not found?

If the route is not found, then phalcon uses default controller. So the only way to detect route not found error is to do smth like this:

$router->setDefaultController('SomeNonExistController');


98.9k

I was thinking in adding a special route to the router to be used when none of the configured routes are matched. Somewhat like:

$router->fallback(array(
    'controller' => 'index',
    'action' => 'notFound' 
));


22.1k

This is also my concern.