X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=module%2FApplication%2FModule.php;h=75282d944d5e5cadb7a0120411c0feedafb13d72;hb=2000f95ea004e3604ce2a7cd8ec655e89d03d95b;hp=5bd9a70bc4d72707b812a25225da049b83bc67fc;hpb=069c369af0d167f7bc1b359468f3136d50429747;p=zf2.biz%2Fgalerie.git diff --git a/module/Application/Module.php b/module/Application/Module.php index 5bd9a70..75282d9 100644 --- a/module/Application/Module.php +++ b/module/Application/Module.php @@ -31,51 +31,19 @@ class Module implements AutoloaderProvider ); } - public function getConfig($env = null) + public function getConfig() { - return include __DIR__ . '/configs/module.config.php'; + return include __DIR__ . '/config/module.config.php'; } public function initializeView($e) { $app = $e->getParam('application'); + $basePath = $app->getRequest()->getBasePath(); $locator = $app->getLocator(); - $config = $e->getParam('config'); - $view = $this->getView($app); - $viewListener = $this->getViewListener($view, $config); - $app->events()->attachAggregate($viewListener); - $events = StaticEventManager::getInstance(); - $viewListener->registerStaticListeners($events, $locator); - } - - protected function getViewListener($view, $config) - { - if ($this->viewListener instanceof View\Listener) { - return $this->viewListener; - } - - $viewListener = new View\Listener($view, $config->layout); - $viewListener->setDisplayExceptionsFlag($config->display_exceptions); - - $this->viewListener = $viewListener; - return $viewListener; - } - - protected function getView($app) - { - if ($this->view) { - return $this->view; - } - - $di = $app->getLocator(); - $view = $di->get('view'); - $url = $view->plugin('url'); - $url->setRouter($app->getRouter()); - - $view->plugin('headTitle')->setSeparator(' - ') - ->setAutoEscape(false) - ->append('Application'); - $this->view = $view; - return $view; + $renderer = $locator->get('Zend\View\Renderer\PhpRenderer'); + $renderer->plugin('url')->setRouter($app->getRouter()); + $renderer->doctype()->setDoctype('HTML5'); + $renderer->plugin('basePath')->setBasePath($basePath); } }