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


PHP Data::urlDecode方法代碼示例

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


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

示例1: decodeTrackingHash

 /**
  * Decode url hash
  *
  * @param  string $hash
  * @return array
  */
 public function decodeTrackingHash($hash)
 {
     $hash = explode(':', $this->_coreData->urlDecode($hash));
     if (count($hash) === 3 && in_array($hash[0], $this->_allowedHashKeys)) {
         return array('key' => $hash[0], 'id' => (int) $hash[1], 'hash' => $hash[2]);
     }
     return array();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:14,代碼來源:Data.php

示例2: _loginPostRedirect

 /**
  * Define target URL and redirect customer after logging in
  *
  * @return void
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 protected function _loginPostRedirect()
 {
     $lastCustomerId = $this->_getSession()->getLastCustomerId();
     if (isset($lastCustomerId) && $this->_getSession()->isLoggedIn() && $lastCustomerId != $this->_getSession()->getId()) {
         $this->_getSession()->unsBeforeAuthUrl()->setLastCustomerId($this->_getSession()->getId());
     }
     if (!$this->_getSession()->getBeforeAuthUrl() || $this->_getSession()->getBeforeAuthUrl() == $this->_storeManager->getStore()->getBaseUrl()) {
         // Set default URL to redirect customer to
         $this->_getSession()->setBeforeAuthUrl($this->_customerHelperData->getAccountUrl());
         // Redirect customer to the last page visited after logging in
         if ($this->_getSession()->isLoggedIn()) {
             if (!$this->_scopeConfig->isSetFlag(\Magento\Customer\Helper\Data::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD, \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) {
                 $referer = $this->getRequest()->getParam(\Magento\Customer\Helper\Data::REFERER_QUERY_PARAM_NAME);
                 if ($referer) {
                     $referer = $this->coreHelperData->urlDecode($referer);
                     if ($this->_url->isOwnOriginUrl()) {
                         $this->_getSession()->setBeforeAuthUrl($referer);
                     }
                 }
             } elseif ($this->_getSession()->getAfterAuthUrl()) {
                 $this->_getSession()->setBeforeAuthUrl($this->_getSession()->getAfterAuthUrl(true));
             }
         } else {
             $this->_getSession()->setBeforeAuthUrl($this->_customerHelperData->getLoginUrl());
         }
     } elseif ($this->_getSession()->getBeforeAuthUrl() == $this->_customerHelperData->getLogoutUrl()) {
         $this->_getSession()->setBeforeAuthUrl($this->_customerHelperData->getDashboardUrl());
     } else {
         if (!$this->_getSession()->getAfterAuthUrl()) {
             $this->_getSession()->setAfterAuthUrl($this->_getSession()->getBeforeAuthUrl());
         }
         if ($this->_getSession()->isLoggedIn()) {
             $this->_getSession()->setBeforeAuthUrl($this->_getSession()->getAfterAuthUrl(true));
         }
     }
     $this->getResponse()->setRedirect($this->_getSession()->getBeforeAuthUrl(true));
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:43,代碼來源:LoginPost.php

示例3: decodeWidgetsFromQuery

 /**
  * Decode URL query param and return list of widgets
  *
  * @param string $queryParam Query param value to decode
  * @return string[] Array of widget types
  */
 public function decodeWidgetsFromQuery($queryParam)
 {
     $param = $this->_coreHelper->urlDecode($queryParam);
     return preg_split('/\\s*\\,\\s*/', $param, 0, PREG_SPLIT_NO_EMPTY);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:11,代碼來源:Config.php


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