Hi,
How can I do when my controller returns different response (400, 403, 404, 410...) to show the good view in the dispatcher ? I want to create a view for each errors.
Here is my beforeException function :
public function beforeException($event, $dispatcher, $exception) {
if ($exception instanceof DispatcherException) {
switch ($exception->getCode()) {
case Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
case Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
$dispatcher->forward(array(
'controller' => 'errors',
'action' => 'show404'
));
return false;
}
}
$dispatcher->forward(array(
'controller' => 'errors',
'action' => 'show500'
));
return false;
}
So, could you tell me how grab the 404 errors or the 410 errors here ?