X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=module%2FApplication%2Fsrc%2FApplication%2FView%2FListener.php;h=100530e91c611227ea8069cf7df6ca90d9d2501b;hb=a3499c5efbdf8b7be69aab4c756588d722ecf4ef;hp=fc99fbaf2bcfbd0ec6ba250b6f983a8c636c6a66;hpb=ef4bab29af1e4dd5aac3f87f1c3d8391808d514d;p=zf2.biz%2Fgalerie.git diff --git a/module/Application/src/Application/View/Listener.php b/module/Application/src/Application/View/Listener.php index fc99fba..100530e 100644 --- a/module/Application/src/Application/View/Listener.php +++ b/module/Application/src/Application/View/Listener.php @@ -55,10 +55,6 @@ class Listener implements ListenerAggregate public function registerStaticListeners(StaticEventCollection $events, $locator) { - $ident = 'Application\Controller\PageController'; - $handler = $events->attach($ident, 'dispatch', array($this, 'renderPageController'), -50); - $this->staticListeners[] = array($ident, $handler); - $ident = 'Zend\Mvc\Controller\ActionController'; $handler = $events->attach($ident, 'dispatch', array($this, 'renderView'), -50); $this->staticListeners[] = array($ident, $handler); @@ -73,39 +69,6 @@ class Listener implements ListenerAggregate } } - public function renderPageController(MvcEvent $e) - { - $page = $e->getResult(); - if ($page instanceof Response) { - return; - } - - $response = $e->getResponse(); - if ($response->isNotFound()) { - return; - } - - $routeMatch = $e->getRouteMatch(); - - if (!$routeMatch) { - $page = '404'; - } else { - $page = $routeMatch->getParam('action', '404'); - } - - if ($page == '404') { - $response->setStatusCode(404); - } - - $script = 'error/' . $page . '.phtml'; - - // Action content - $content = $this->view->render($script); - $e->setResult($content); - - return $this->renderLayout($e); - } - public function renderView(MvcEvent $e) { $response = $e->getResponse(); @@ -187,7 +150,6 @@ class Listener implements ListenerAggregate public function renderError(MvcEvent $e) { $error = $e->getError(); - $app = $e->getTarget(); $response = $e->getResponse(); if (!$response) { $response = new Response(); @@ -207,7 +169,6 @@ class Listener implements ListenerAggregate case Application::ERROR_EXCEPTION: default: - $exception = $e->getParam('exception'); $vars = array( 'message' => 'An error occurred during execution; please try again later.', 'exception' => $e->getParam('exception'),