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-contact
Controller
Index.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Contact\Controller
;
7
8
use
Magento\Contact\Model\ConfigInterface
;
9
use
Magento\Framework\App\Action\Context
;
10
use
Magento\Framework\App\RequestInterface
;
11
use
Magento\Framework\Exception\NotFoundException
;
12
16
abstract
class
Index
extends
\Magento\Framework\App\Action\Action
17
{
21
const
XML_PATH_EMAIL_RECIPIENT
=
ConfigInterface::XML_PATH_EMAIL_RECIPIENT
;
22
26
const
XML_PATH_EMAIL_SENDER
=
ConfigInterface::XML_PATH_EMAIL_SENDER
;
27
31
const
XML_PATH_EMAIL_TEMPLATE
=
ConfigInterface::XML_PATH_EMAIL_TEMPLATE
;
32
36
const
XML_PATH_ENABLED
=
ConfigInterface::XML_PATH_ENABLED
;
37
41
private
$contactsConfig;
42
47
public
function
__construct
(
48
Context
$context,
49
ConfigInterface
$contactsConfig
50
) {
51
parent::__construct($context);
52
$this->contactsConfig = $contactsConfig;
53
}
54
62
public
function
dispatch
(
RequestInterface
$request
)
63
{
64
if
(!$this->contactsConfig->isEnabled()) {
65
throw
new
NotFoundException
(
__
(
'Page not found.'
));
66
}
67
return
parent::dispatch(
$request
);
68
}
69
}
Magento\Contact\Model\ConfigInterface\XML_PATH_EMAIL_TEMPLATE
const XML_PATH_EMAIL_TEMPLATE
Definition:
ConfigInterface.php:29
Magento\Contact\Controller\Index\XML_PATH_EMAIL_RECIPIENT
const XML_PATH_EMAIL_RECIPIENT
Definition:
Index.php:21
Magento\Contact\Model\ConfigInterface
Definition:
ConfigInterface.php:14
Magento\Contact\Controller
Definition:
IndexTest.php:7
Magento\Contact\Controller\Index\XML_PATH_ENABLED
const XML_PATH_ENABLED
Definition:
Index.php:36
__
__()
Definition:
__.php:13
Magento\Contact\Controller\Index
Definition:
Index.php:16
Magento\Contact\Model\ConfigInterface\XML_PATH_ENABLED
const XML_PATH_ENABLED
Definition:
ConfigInterface.php:34
Magento\Framework\Exception\NotFoundException
Definition:
NotFoundException.php:12
Magento\Contact\Controller\Index\XML_PATH_EMAIL_SENDER
const XML_PATH_EMAIL_SENDER
Definition:
Index.php:26
Magento\Contact\Model\ConfigInterface\XML_PATH_EMAIL_SENDER
const XML_PATH_EMAIL_SENDER
Definition:
ConfigInterface.php:24
Magento\Framework\App\RequestInterface
Definition:
RequestInterface.php:14
$request
$request
Definition:
quote_with_configurable_product_last_variation.php:22
Magento\Contact\Controller\Index\dispatch
dispatch(RequestInterface $request)
Definition:
Index.php:62
Magento\Contact\Controller\Index\XML_PATH_EMAIL_TEMPLATE
const XML_PATH_EMAIL_TEMPLATE
Definition:
Index.php:31
Magento\Framework\App\Action\Context
Definition:
Context.php:24
Magento\Contact\Controller\Index\__construct
__construct(Context $context, ConfigInterface $contactsConfig)
Definition:
Index.php:47
Magento\Framework\App\Action\Action
Definition:
Action.php:25
Magento\Contact\Model\ConfigInterface\XML_PATH_EMAIL_RECIPIENT
const XML_PATH_EMAIL_RECIPIENT
Definition:
ConfigInterface.php:19