This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Index.php
executable file
·77 lines (68 loc) · 1.85 KB
/
Index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_Sitemap
* @copyright Copyright (c) Mageplaza (http://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Sitemap\Controller\Index;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\Exception\NotFoundException;
use Magento\Framework\View\Result\Page;
use Magento\Framework\View\Result\PageFactory;
use Mageplaza\Sitemap\Helper\Data as HelperConfig;
/**
* Class Index
* @package Mageplaza\Sitemap\Controller\Index
*/
class Index extends Action
{
/**
* @var PageFactory
*/
protected $pageFactory;
/**
* @var HelperConfig
*/
protected $helperConfig;
/**
* Index constructor.
*
* @param Context $context
* @param PageFactory $pageFactory
* @param HelperConfig $helperConfig
*/
public function __construct(Context $context, PageFactory $pageFactory, HelperConfig $helperConfig)
{
$this->pageFactory = $pageFactory;
$this->helperConfig = $helperConfig;
return parent::__construct($context);
}
/**
* @return Page
* @throws NotFoundException
*/
public function execute()
{
if (!$this->helperConfig->isEnableHtmlSiteMap()) {
throw new NotFoundException(__('Parameter is incorrect.'));
}
$page = $this->pageFactory->create();
$page->getConfig()->getTitle()->set(__('HTML Sitemap'));
return $page;
}
}