5
5
*/
6
6
namespace Magento \Search \Controller \Term ;
7
7
8
+ use Magento \Framework \App \Action \Action ;
8
9
use Magento \Framework \App \Action \Context ;
10
+ use Magento \Framework \App \Config \ScopeConfigInterface ;
9
11
use Magento \Framework \App \RequestInterface ;
10
- use Magento \Framework \App \ResponseInterface ;
12
+ use Magento \Store \Model \ScopeInterface ;
13
+ use Magento \Framework \Controller \ResultFactory ;
11
14
12
- class Popular extends \ Magento \ Framework \ App \ Action \ Action
15
+ class Popular extends Action
13
16
{
14
17
/**
15
18
* @var \Magento\Framework\App\Config\ScopeConfigInterface
16
19
*/
17
20
protected $ scopeConfig ;
18
21
19
22
/**
20
- * @param Context $context
23
+ * @param \Magento\Framework\App\Action\ Context $context
21
24
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
22
25
*/
23
- public function __construct (Context $ context , \ Magento \ Framework \ App \ Config \ ScopeConfigInterface $ scopeConfig )
26
+ public function __construct (Context $ context , ScopeConfigInterface $ scopeConfig )
24
27
{
25
28
$ this ->scopeConfig = $ scopeConfig ;
26
29
parent ::__construct ($ context );
@@ -29,14 +32,14 @@ public function __construct(Context $context, \Magento\Framework\App\Config\Scop
29
32
/**
30
33
* Dispatch request
31
34
*
32
- * @param RequestInterface $request
33
- * @return ResponseInterface
35
+ * @param \Magento\Framework\App\ RequestInterface $request
36
+ * @return \Magento\Framework\App\ ResponseInterface
34
37
*/
35
38
public function dispatch (RequestInterface $ request )
36
39
{
37
40
$ searchTerms = $ this ->scopeConfig ->getValue (
38
41
'catalog/seo/search_terms ' ,
39
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
42
+ ScopeInterface::SCOPE_STORE
40
43
);
41
44
if (!$ searchTerms ) {
42
45
$ this ->_redirect ('noroute ' );
@@ -46,11 +49,12 @@ public function dispatch(RequestInterface $request)
46
49
}
47
50
48
51
/**
49
- * @return void
52
+ * @return \Magento\Framework\View\Result\Page
50
53
*/
51
54
public function execute ()
52
55
{
53
- $ this ->_view ->loadLayout ();
54
- $ this ->_view ->renderLayout ();
56
+ /** @var \Magento\Framework\View\Result\Page $resultPage */
57
+ $ resultPage = $ this ->resultFactory ->create (ResultFactory::TYPE_PAGE );
58
+ return $ resultPage ;
55
59
}
56
60
}
0 commit comments