本文整理汇总了PHP中Magento\Framework\UrlInterface::sessionUrlVar方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlInterface::sessionUrlVar方法的具体用法?PHP UrlInterface::sessionUrlVar怎么用?PHP UrlInterface::sessionUrlVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\UrlInterface
的用法示例。
在下文中一共展示了UrlInterface::sessionUrlVar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
*
* @param \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory
* @param \Magento\Backend\App\ConfigInterface $config
* @param \Magento\Framework\UrlInterface $url
* @param \Inchoo\SocialConnect\Helper\Data $helperData
* @param array $data
*/
public function __construct(\Magento\Framework\HTTP\ZendClientFactory $httpClientFactory, \Magento\Backend\App\ConfigInterface $config, \Magento\Framework\UrlInterface $url, \Inchoo\SocialConnect\Helper\Data $helperData, array $data = array())
{
$this->_httpClientFactory = $httpClientFactory;
$this->_config = $config;
$this->_url = $url;
$this->_redirectUri = $this->_url->sessionUrlVar($this->_url->getUrl(self::REDIRECT_URI_ROUTE));
$this->_helperData = $helperData;
$this->_clientId = $this->_getClientId();
$this->_clientSecret = $this->_getClientSecret();
$this->_config = $config;
parent::__construct($data);
}
示例2: decode
/**
* base64_decode() for URLs decoding
*
* @param string $url
* @return string
*/
public function decode($url)
{
$url = base64_decode(strtr($url, '-_,', '+/='));
return $this->urlBuilder->sessionUrlVar($url);
}
示例3: testSessionUrlVar
/**
* Note: isolation flushes the URL memory cache
* @magentoAppIsolation enabled
*
* Note: to enforce SID in URLs, base URL must be different from the current $_SERVER['HTTP_HOST']
* @magentoConfigFixture current_store web/unsecure/base_link_url http://domain.com/
*/
public function testSessionUrlVar()
{
$sessionId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\Session\\Generic')->getSessionId();
$sessionUrl = $this->_model->sessionUrlVar('<a href="http://example.com/?___SID=U">www.example.com</a>');
$this->assertEquals('<a href="http://example.com/?SID=' . $sessionId . '">www.example.com</a>', $sessionUrl);
}