本文整理汇总了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();
}
示例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));
}
示例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);
}