本文整理汇总了PHP中Magento\Framework\UrlInterface::isOwnOriginUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlInterface::isOwnOriginUrl方法的具体用法?PHP UrlInterface::isOwnOriginUrl怎么用?PHP UrlInterface::isOwnOriginUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\UrlInterface
的用法示例。
在下文中一共展示了UrlInterface::isOwnOriginUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSid
/**
* @param SessionManagerInterface $session
* @return string
*/
public function getSid(SessionManagerInterface $session)
{
$sidKey = null;
$useSidOnFrontend = $this->scopeConfig->getValue(self::XML_PATH_USE_FRONTEND_SID, $this->_scopeType);
if ($useSidOnFrontend && $this->request->getQuery($this->getSessionIdQueryParam($session), false) && $this->urlBuilder->isOwnOriginUrl()) {
$sidKey = $this->request->getQuery($this->getSessionIdQueryParam($session));
}
return $sidKey;
}
示例2: testIsOwnOriginUrl
/**
* Note: isolation flushes the URL memory cache
* @magentoAppIsolation enabled
*/
public function testIsOwnOriginUrl()
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var $request \Magento\TestFramework\Request */
$request = $objectManager->get('Magento\\Framework\\App\\RequestInterface');
$request->setServer(array('HTTP_REFERER' => 'http://localhost/'));
$this->assertTrue($this->_model->isOwnOriginUrl());
$request->setServer(array('HTTP_REFERER' => 'http://example.com/'));
$this->assertFalse($this->_model->isOwnOriginUrl());
}
示例3: processLoggedCustomer
/**
* Prepare redirect URL for logged in customer
*
* Redirect customer to the last page visited after logging in.
*
* @return void
*/
protected function processLoggedCustomer()
{
// Set default redirect URL for logged in customer
$this->applyRedirect($this->customerUrl->getAccountUrl());
if (!$this->scopeConfig->isSetFlag(CustomerUrl::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD, ScopeInterface::SCOPE_STORE)) {
$referer = $this->request->getParam(CustomerUrl::REFERER_QUERY_PARAM_NAME);
if ($referer) {
$referer = $this->urlDecoder->decode($referer);
if ($this->url->isOwnOriginUrl()) {
$this->applyRedirect($referer);
}
}
} elseif ($this->session->getAfterAuthUrl()) {
$this->applyRedirect($this->session->getAfterAuthUrl(true));
}
}