當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Data::getAreaFrontName方法代碼示例

本文整理匯總了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;
 }
開發者ID:dragonsword007008,項目名稱:magento2,代碼行數:12,代碼來源:SecurityCookie.php

示例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;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:16,代碼來源:PathInfoProcessor.php

示例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);
 }
開發者ID:whoople,項目名稱:magento2-testing,代碼行數:17,代碼來源:AfterCustomUrlChangedObserver.php

示例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;
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:19,代碼來源:NoRouteHandler.php

示例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');
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:12,代碼來源:Url.php

示例6: testGetAreaFrontNameLocalConfigCustomFrontName

 public function testGetAreaFrontNameLocalConfigCustomFrontName()
 {
     $this->_frontResolverMock->expects($this->once())->method('getFrontName')->will($this->returnValue('custom_backend'));
     $this->assertEquals('custom_backend', $this->_helper->getAreaFrontName());
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:5,代碼來源:DataTest.php


注:本文中的Magento\Backend\Helper\Data::getAreaFrontName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。