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


PHP Http::getUrlNoScript方法代碼示例

本文整理匯總了PHP中Magento\Framework\App\Request\Http::getUrlNoScript方法的典型用法代碼示例。如果您正苦於以下問題:PHP Http::getUrlNoScript方法的具體用法?PHP Http::getUrlNoScript怎麽用?PHP Http::getUrlNoScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\App\Request\Http的用法示例。


在下文中一共展示了Http::getUrlNoScript方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: extractAdminPath

 /**
  * Determine the admin path
  *
  * @return string
  */
 private function extractAdminPath()
 {
     $backendApp = $this->backendAppList->getCurrentApp();
     $cookiePath = null;
     $baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
     if (!$backendApp) {
         $cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName();
         return $cookiePath;
     }
     //In case of application authenticating through the admin login, the script name should be removed
     //from the path, because application has own script.
     $baseUrl = \Magento\Framework\App\Request\Http::getUrlNoScript($baseUrl);
     $cookiePath = $baseUrl . $backendApp->getCookiePath();
     return $cookiePath;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:20,代碼來源:AdminConfig.php

示例2: getReferer

 /**
  * @return string
  */
 public function getReferer()
 {
     return \Magento\Framework\App\Request\Http::getUrlNoScript($this->backendUrl->getBaseUrl()) . 'admin/marketplace/index/index';
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:7,代碼來源:Partners.php

示例3: aroundDispatch

 /**
  * @param \Magento\Backend\App\AbstractAction $subject
  * @param callable $proceed
  * @param \Magento\Framework\App\RequestInterface $request
  *
  * @return mixed
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundDispatch(\Magento\Backend\App\AbstractAction $subject, \Closure $proceed, \Magento\Framework\App\RequestInterface $request)
 {
     $requestedActionName = $request->getActionName();
     if (in_array($requestedActionName, $this->_openActions)) {
         $request->setDispatched(true);
     } else {
         if ($this->_auth->getUser()) {
             $this->_auth->getUser()->reload();
         }
         if (!$this->_auth->isLoggedIn()) {
             $this->_processNotLoggedInUser($request);
         } else {
             $this->_auth->getAuthStorage()->prolong();
             $backendApp = null;
             if ($request->getParam('app')) {
                 $backendApp = $this->backendAppList->getCurrentApp();
             }
             if ($backendApp) {
                 $resultRedirect = $this->resultRedirectFactory->create();
                 $baseUrl = \Magento\Framework\App\Request\Http::getUrlNoScript($this->backendUrl->getBaseUrl());
                 $baseUrl = $baseUrl . $backendApp->getStartupPage();
                 return $resultRedirect->setUrl($baseUrl);
             }
         }
     }
     $this->_auth->getAuthStorage()->refreshAcl();
     return $proceed($request);
 }
開發者ID:whoople,項目名稱:magento2-testing,代碼行數:36,代碼來源:Authentication.php

示例4: getSetupCookiePath

 /**
  * Get cookie path
  *
  * @param \Magento\Framework\ObjectManagerInterface $objectManager
  * @return string
  */
 private function getSetupCookiePath(\Magento\Framework\ObjectManagerInterface $objectManager)
 {
     /** @var \Magento\Backend\App\BackendAppList $backendAppList */
     $backendAppList = $objectManager->get(\Magento\Backend\App\BackendAppList::class);
     $backendApp = $backendAppList->getBackendApp('setup');
     /** @var \Magento\Backend\Model\UrlFactory $backendUrlFactory */
     $backendUrlFactory = $objectManager->get(\Magento\Backend\Model\UrlFactory::class);
     $baseUrl = parse_url($backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
     $baseUrl = \Magento\Framework\App\Request\Http::getUrlNoScript($baseUrl);
     $cookiePath = $baseUrl . $backendApp->getCookiePath();
     return $cookiePath;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:18,代碼來源:InitParamListener.php


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