本文整理匯總了PHP中Magento\Customer\Model\Session::getNoReferer方法的典型用法代碼示例。如果您正苦於以下問題:PHP Session::getNoReferer方法的具體用法?PHP Session::getNoReferer怎麽用?PHP Session::getNoReferer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Customer\Model\Session
的用法示例。
在下文中一共展示了Session::getNoReferer方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getLoginUrlParams
/**
* Retrieve parameters of customer login url
*
* @return array
*/
public function getLoginUrlParams()
{
$params = [];
$referer = $this->request->getParam(self::REFERER_QUERY_PARAM_NAME);
if (!$referer && !$this->scopeConfig->isSetFlag(self::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD, ScopeInterface::SCOPE_STORE) && !$this->customerSession->getNoReferer()) {
$referer = $this->urlBuilder->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);
$referer = $this->urlEncoder->encode($referer);
}
if ($referer) {
$params = [self::REFERER_QUERY_PARAM_NAME => $referer];
}
return $params;
}
示例2: getLoginUrlParams
/**
* Retrieve parameters of customer login url
*
* @return array
*/
public function getLoginUrlParams()
{
$params = array();
$referer = $this->_getRequest()->getParam(self::REFERER_QUERY_PARAM_NAME);
if (!$referer && !$this->_scopeConfig->isSetFlag(self::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD, \Magento\Store\Model\ScopeInterface::SCOPE_STORE) && !$this->_customerSession->getNoReferer()) {
$referer = $this->_getUrl('*/*/*', array('_current' => true, '_use_rewrite' => true));
$referer = $this->_coreData->urlEncode($referer);
}
if ($referer) {
$params = array(self::REFERER_QUERY_PARAM_NAME => $referer);
}
return $params;
}