protected function attachDefaultListeners() { $events = $this->getEventManager(); $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'onDispatch']); }
protected function attachDefaultListeners() { parent::attachDefaultListeners(); $this->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, function (MvcEvent $event) { $event->getTarget()->layout('layout/frontend/gallery'); }); }