Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
UrlBuilder Class Reference
Inheritance diagram for UrlBuilder:
UrlBuilderInterface

Public Member Functions

 __construct (\Magento\Framework\UrlInterface $urlBuilder, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
 
 getUrl (array $queryParams=[])
 

Protected Attributes

 $urlBuilder
 
 $config
 

Detailed Description

Definition at line 14 of file UrlBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\UrlInterface  $urlBuilder,
\Magento\Framework\App\Config\ScopeConfigInterface  $scopeConfig 
)
Parameters
\Magento\Framework\UrlInterface$urlBuilder
\Magento\Framework\App\Config\ScopeConfigInterface$scopeConfig

Definition at line 30 of file UrlBuilder.php.

33  {
34  $this->urlBuilder = $urlBuilder;
35  $this->config = $scopeConfig;
36  }

Member Function Documentation

◆ getUrl()

getUrl ( array  $queryParams = [])
Parameters
array$queryParams
Returns
string

Implements UrlBuilderInterface.

Definition at line 42 of file UrlBuilder.php.

43  {
44  if (!$this->config->getValue('rss/config/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) {
45  return '';
46  }
47 
48  return $this->urlBuilder->getUrl('rss/feed/index', $queryParams);
49  }

Field Documentation

◆ $config

$config
protected

Definition at line 24 of file UrlBuilder.php.

◆ $urlBuilder

$urlBuilder
protected

Definition at line 19 of file UrlBuilder.php.


The documentation for this class was generated from the following file: