3 namespace Application\Controller;
5 use Zend\Mvc\Controller\ActionController;
7 class ErrorController extends ActionController
9 const ERROR_NO_ROUTE = 404;
10 const ERROR_NO_CONTROLLER = 404;
12 public function indexAction()
14 $error = $this->request->getMetadata('error', false);
18 'message' => 'Page not found',
22 switch ($error['type']) {
23 case self::ERROR_NO_ROUTE:
24 case self::ERROR_NO_CONTROLLER:
26 // 404 error -- controller or action not found
27 $this->response->setStatusCode(404);
31 return array('message' => $error['message']);