示例#1
0
 /**
  * @return string
  */
 protected function _getUrl()
 {
     $refererUrl = $this->_request->getServer('HTTP_REFERER');
     $url = (string) $this->_request->getParam(self::PARAM_NAME_REFERER_URL);
     if ($url) {
         $refererUrl = $url;
     }
     $url = $this->_request->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_BASE64_URL);
     if ($url) {
         $refererUrl = $this->_urlCoder->decode($url);
     }
     $url = $this->_request->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED);
     if ($url) {
         $refererUrl = $this->_urlCoder->decode($url);
     }
     if (!$this->_isUrlInternal($refererUrl)) {
         $refererUrl = $this->_storeManager->getStore()->getBaseUrl();
     }
     return $refererUrl;
 }
示例#2
0
文件: Css.php 项目: aiesh/magento2
 /**
  * Get URL to download CSS file
  *
  * @param string $fileId
  * @param int $themeId
  * @return string
  */
 public function getDownloadUrl($fileId, $themeId)
 {
     return $this->getUrl('adminhtml/*/downloadCss', array('theme_id' => $themeId, 'file' => $this->urlCoder->encode($fileId)));
 }
示例#3
0
 public function testEncode()
 {
     $this->assertEquals($this->_encodeUrl, $this->_urlCoder->encode($this->_url));
 }