当前位置: 首页>>代码示例>>PHP>>正文


PHP UrlInterface::isOwnOriginUrl方法代码示例

本文整理汇总了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;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:13,代码来源:SidResolver.php

示例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());
 }
开发者ID:aiesh,项目名称:magento2,代码行数:14,代码来源:UrlTest.php

示例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));
     }
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:23,代码来源:Redirect.php


注:本文中的Magento\Framework\UrlInterface::isOwnOriginUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。