MaintenancePageLoadedEvent example

$page = MaintenancePage::createFrom($page);

            /** @var CmsPageCollection $pages */
            $pages = $this->cmsPageLoader->load($requestnew Criteria([$cmsErrorLayoutId])$context)->getEntities();

            if (!$pages->has($cmsErrorLayoutId)) {
                throw new PageNotFoundException($cmsErrorLayoutId);
            }

            $page->setCmsPage($pages->get($cmsErrorLayoutId));

            $this->eventDispatcher->dispatch(new MaintenancePageLoadedEvent($page$context$request));

            return $page;
        } catch (\Exception) {
            throw new PageNotFoundException($cmsErrorLayoutId);
        }
    }
}
Home | Imprint | This part of the site doesn't use cookies.