3 namespace Application\Controller;
5 use Zend\Mvc\Controller\ActionController,
6 Zend\View\Model\ViewModel;
8 class ErrorController extends ActionController
10 const ERROR_NO_ROUTE = 404;
11 const ERROR_NO_CONTROLLER = 404;
13 public function indexAction()
15 $error = $this->request->getMetadata('error', false);
19 'message' => 'Page not found',
23 switch ($error['type']) {
24 case self::ERROR_NO_ROUTE:
25 case self::ERROR_NO_CONTROLLER:
27 // 404 error -- controller or action not found
28 $this->response->setStatusCode(404);
32 return new ViewModel(array('message' => $error['message']));