Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
UrlBuilder.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Rss\Model;
7 
9 
15 {
19  protected $urlBuilder;
20 
24  protected $config;
25 
30  public function __construct(
31  \Magento\Framework\UrlInterface $urlBuilder,
32  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
33  ) {
34  $this->urlBuilder = $urlBuilder;
35  $this->config = $scopeConfig;
36  }
37 
42  public function getUrl(array $queryParams = [])
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  }
50 }
getUrl(array $queryParams=[])
Definition: UrlBuilder.php:42
__construct(\Magento\Framework\UrlInterface $urlBuilder, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
Definition: UrlBuilder.php:30