Hi all,
I'm triying to catch a beforeException
when an action does not exists but it does fire before the beforeExecuteRoute
that I have at the controller.
this is the code:
abstract class ControllerWeb extends Controller
{
public function beforeExecuteRoute(Dispatcher $dispatcher)
{
die("beforeExecuteRoute");
}
}
class PagePlugin extends Plugin
{
public function beforeException(Event $event, Dispatcher $dispatcher, \Exception $exception = null)
{
die("beforeException");
}
}
When I try to access to a non defined action I want my beforeException
to fire, but AFTER the beforeExecuteRoute
The beforeExecuteRoute
fires properly on other cases, but when the Action is not defined the beforeException fires first. Is this the normal behaviour? As I see it the beforeExecuteRoute
must fire first since we don't care yet about the action or controller exceptions, right?