70 \
Magento\Framework\Event\ManagerInterface $eventManager,
72 \
Magento\Cms\Model\PageFactory $pageFactory,
77 $this->_eventManager = $eventManager;
79 $this->_pageFactory = $pageFactory;
92 $identifier = trim(
$request->getPathInfo(),
'/');
94 $condition = new \Magento\Framework\DataObject([
'identifier' => $identifier,
'continue' =>
true]);
95 $this->_eventManager->dispatch(
96 'cms_controller_router_match_before',
97 [
'router' => $this,
'condition' => $condition]
99 $identifier = $condition->getIdentifier();
101 if ($condition->getRedirectUrl()) {
102 $this->_response->setRedirect($condition->getRedirectUrl());
104 return $this->actionFactory->create(\
Magento\Framework\
App\Action\Redirect::class);
107 if (!$condition->getContinue()) {
112 $page = $this->_pageFactory->create();
113 $pageId =
$page->checkIdentifier($identifier, $this->_storeManager->getStore()->getId());
118 $request->setModuleName(
'cms')->setControllerName(
'page')->setActionName(
'view')->setParam(
'page_id', $pageId);
119 $request->setAlias(\
Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS, $identifier);
121 return $this->actionFactory->create(\
Magento\Framework\
App\Action\Forward::class);
__construct(\Magento\Framework\App\ActionFactory $actionFactory, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\UrlInterface $url, \Magento\Cms\Model\PageFactory $pageFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\App\ResponseInterface $response)
match(RequestInterface $request)