-
- public function getConfig()
- {
- return include __DIR__ . '/config/module.config.php';
- }
-
- public function initializeView($e)
- {
- $app = $e->getParam('application');
- $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;
- }