Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Popular.php
Go to the documentation of this file.
1 <?php
7 
14 
15 class Popular extends Action
16 {
20  protected $scopeConfig;
21 
27  {
28  $this->scopeConfig = $scopeConfig;
29  parent::__construct($context);
30  }
31 
40  {
41  $searchTerms = $this->scopeConfig->getValue(
42  'catalog/seo/search_terms',
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 }
_redirect($path, $arguments=[])
Definition: Action.php:167