X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=module%2FApplication%2Fsrc%2FApplication%2FView%2FListener.php;h=568340510fe2cd5acdc010ced50af24c1f53ad0a;hb=2d4c24e88b0696fd52d63c29fc7cec8d0c584184;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..5683405 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();