Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-rss
Controller
Adminhtml
Feed
Index.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Rss\Controller\Adminhtml\Feed
;
8
9
use
Magento\Framework\Exception\NotFoundException
;
10
15
class
Index
extends
\Magento\Rss\Controller\Adminhtml\Feed
16
{
23
public
function
execute
()
24
{
25
if
(!$this->scopeConfig->getValue(
'rss/config/active'
, \
Magento
\Store\Model\ScopeInterface::SCOPE_STORE)) {
26
throw
new
NotFoundException
(
__
(
'Page not found.'
));
27
}
28
29
$type
= $this->
getRequest
()->getParam(
'type'
);
30
try
{
31
$provider = $this->rssManager->getProvider(
$type
);
32
}
catch
(\InvalidArgumentException $e) {
33
throw
new
NotFoundException
(
__
($e->getMessage()));
34
}
35
36
if
(!$provider->isAllowed()) {
37
throw
new
NotFoundException
(
__
(
'Page not found.'
));
38
}
39
41
$rss = $this->rssFactory->create();
42
$rss->setDataProvider($provider);
43
44
$this->
getResponse
()->setHeader(
'Content-type'
,
'text/xml; charset=UTF-8'
);
45
$this->
getResponse
()->setBody($rss->createRssXml());
46
}
47
}
Magento\Framework\App\Action\AbstractAction\getResponse
getResponse()
Definition:
AbstractAction.php:70
__
__()
Definition:
__.php:13
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
$type
$type
Definition:
item.phtml:13
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Rss\Controller\Adminhtml\Feed\Index
Definition:
Index.php:15
Magento\Framework\Exception\NotFoundException
Definition:
NotFoundException.php:12
Magento\Rss\Controller\Adminhtml\Feed
Definition:
Index.php:7
Magento
Magento\Rss\Controller\Adminhtml\Feed
Definition:
Feed.php:12