本文整理汇总了PHP中Magento\Backend\Helper\Data::getAreaFrontName方法的典型用法代码示例。如果您正苦于以下问题:PHP Data::getAreaFrontName方法的具体用法?PHP Data::getAreaFrontName怎么用?PHP Data::getAreaFrontName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Backend\Helper\Data
的用法示例。
在下文中一共展示了Data::getAreaFrontName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteLogoutReasonCookie
/**
* Delete cookie with reason of logout
*
* @return $this
*/
public function deleteLogoutReasonCookie()
{
$metaData = $this->createCookieMetaData();
$metaData->setPath('/' . $this->backendData->getAreaFrontName())->setDuration(-1);
$this->phpCookieManager->setPublicCookie(self::LOGOUT_REASON_CODE_COOKIE_NAME, '', $metaData);
return $this;
}
示例2: process
/**
* Process path info
*
* @param \Magento\Framework\App\RequestInterface $request
* @param string $pathInfo
* @return string
*/
public function process(\Magento\Framework\App\RequestInterface $request, $pathInfo)
{
$pathParts = explode('/', ltrim($pathInfo, '/'), 2);
$firstPart = $pathParts[0];
if ($firstPart != $this->_helper->getAreaFrontName()) {
return $this->_subject->process($request, $pathInfo);
}
return $pathInfo;
}
示例3: execute
/**
* Log out user and redirect him to new admin custom url
*
* @param \Magento\Framework\Event\Observer $observer
* @return void
* @SuppressWarnings(PHPMD.ExitExpression)
*/
public function execute(\Magento\Framework\Event\Observer $observer)
{
if ($this->_coreRegistry->registry('custom_admin_path_redirect') === null) {
return;
}
$this->_authSession->destroy();
$route = $this->_backendData->getAreaFrontName();
$this->_response->setRedirect($this->_storeManager->getStore()->getBaseUrl() . $route)->sendResponse();
exit(0);
}
示例4: process
/**
* Check and process no route request
*
* @param \Magento\Framework\App\RequestInterface $request
* @return bool
*/
public function process(\Magento\Framework\App\RequestInterface $request)
{
$requestPathParams = explode('/', trim($request->getPathInfo(), '/'));
$areaFrontName = array_shift($requestPathParams);
if ($areaFrontName == $this->helper->getAreaFrontName()) {
$moduleName = $this->routeConfig->getRouteFrontName('adminhtml');
$actionNamespace = 'noroute';
$actionName = 'index';
$request->setModuleName($moduleName)->setControllerName($actionNamespace)->setActionName($actionName);
return true;
}
return false;
}
示例5: getAreaFrontName
/**
* Return backend area front name, defined in configuration
*
* @return string
*/
public function getAreaFrontName()
{
if (!$this->_getData('area_front_name')) {
$this->setData('area_front_name', $this->_backendHelper->getAreaFrontName());
}
return $this->_getData('area_front_name');
}
示例6: testGetAreaFrontNameLocalConfigCustomFrontName
public function testGetAreaFrontNameLocalConfigCustomFrontName()
{
$this->_frontResolverMock->expects($this->once())->method('getFrontName')->will($this->returnValue('custom_backend'));
$this->assertEquals('custom_backend', $this->_helper->getAreaFrontName());
}