<?php
return array(
'Application\Controller\IndexController' => __DIR__ . '/src/Application/Controller/IndexController.php',
- 'Application\Controller\ErrorController' => __DIR__ . '/src/Application/Controller/ErrorController.php',
'Application\Module' => __DIR__ . '/Module.php',
);
+++ /dev/null
-<?php
-
-namespace Application\Controller;
-
-use Zend\Mvc\Controller\ActionController,
- Zend\View\Model\ViewModel;
-
-class ErrorController extends ActionController
-{
- const ERROR_NO_ROUTE = 404;
- const ERROR_NO_CONTROLLER = 404;
-
- public function indexAction()
- {
- $error = $this->request->getMetadata('error', false);
- if (!$error) {
- $error = array(
- 'type' => 404,
- 'message' => 'Page not found',
- );
- }
-
- switch ($error['type']) {
- case self::ERROR_NO_ROUTE:
- case self::ERROR_NO_CONTROLLER:
- default:
- // 404 error -- controller or action not found
- $this->response->setStatusCode(404);
- break;
- }
-
- return new ViewModel(array('message' => $error['message']));
- }
-}