In the securing invo guide there are two dispatchers attached to the event manager, one for securing the controllers while the other is to control not found exceptions.
/** * Check if the user is allowed to access certain action using the SecurityPlugin */ $eventsManager->attach('dispatch:beforeDispatch', new SecurityPlugin); /** * Handle exceptions and not-found exceptions using NotFoundPlugin */ $eventsManager->attach('dispatch:beforeException', new NotFoundPlugin);
Since beforeDispatch is dispatched first in the event loop, non existent controllers or actions will be catched by the security plugin when they should be catched by the notfound plugin.
How can I change this behaviour? I want non existent controllers or action to be catched by the notfound plugin and not the security one.