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-search
Controller
Term
Popular.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Search\Controller\Term
;
7
8
use
Magento\Framework\App\Action\Action
;
9
use
Magento\Framework\App\Action\Context
;
10
use
Magento\Framework\App\Config\ScopeConfigInterface
;
11
use
Magento\Framework\App\RequestInterface
;
12
use
Magento\Store\Model\ScopeInterface
;
13
use
Magento\Framework\Controller\ResultFactory
;
14
15
class
Popular
extends
Action
16
{
20
protected
$scopeConfig
;
21
26
public
function
__construct
(
Context
$context,
ScopeConfigInterface
$scopeConfig
)
27
{
28
$this->scopeConfig =
$scopeConfig
;
29
parent::__construct($context);
30
}
31
39
public
function
dispatch
(
RequestInterface
$request
)
40
{
41
$searchTerms = $this->scopeConfig->getValue(
42
'catalog/seo/search_terms'
,
43
ScopeInterface::SCOPE_STORE
44
);
45
if
(!$searchTerms) {
46
$this->
_redirect
(
'noroute'
);
47
$this->_actionFlag->set(
''
, self::FLAG_NO_DISPATCH,
true
);
48
}
49
return
parent::dispatch(
$request
);
50
}
51
55
public
function
execute
()
56
{
58
$resultPage = $this->resultFactory->create(
ResultFactory::TYPE_PAGE
);
59
return
$resultPage;
60
}
61
}
Magento\Framework\App\Action\Action\_redirect
_redirect($path, $arguments=[])
Definition:
Action.php:167
Magento\Store\Model\ScopeInterface\SCOPE_STORE
const SCOPE_STORE
Definition:
ScopeInterface.php:21
Magento\Framework\Controller\ResultFactory
Definition:
ResultFactory.php:17
Magento\Search\Controller\Term\Popular
Definition:
Popular.php:15
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Search\Controller\Term\Popular\__construct
__construct(Context $context, ScopeConfigInterface $scopeConfig)
Definition:
Popular.php:26
Magento\Store\Model\ScopeInterface
Definition:
ScopeInterface.php:12
Magento\Search\Controller\Term\Popular\$scopeConfig
$scopeConfig
Definition:
Popular.php:20
Magento\Framework\App\RequestInterface
Definition:
RequestInterface.php:14
Magento\Search\Controller\Term\Popular\dispatch
dispatch(RequestInterface $request)
Definition:
Popular.php:39
$request
$request
Definition:
quote_with_configurable_product_last_variation.php:22
Magento\Framework\Controller\ResultFactory\TYPE_PAGE
const TYPE_PAGE
Definition:
ResultFactory.php:27
Magento\Framework\App\Action\Context
Definition:
Context.php:24
Magento\Framework\App\Config\ScopeConfigInterface
Definition:
ScopeConfigInterface.php:15
Magento\Search\Controller\Term
Definition:
Popular.php:6
Magento\Framework\App\Action\Action
Definition:
Action.php:25