Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
Data Class Reference
Inheritance diagram for Data:
AbstractHelper

Public Member Functions

 __construct (\Magento\Framework\App\Helper\Context $context, \Magento\Customer\Model\Session $customerSession, CustomerViewHelper $customerViewHelper)
 
 isEnabled ()
 
 getPostValue ($key)
 
- Public Member Functions inherited from AbstractHelper
 __construct (Context $context)
 
 isModuleOutputEnabled ($moduleName=null)
 

Data Fields

const XML_PATH_ENABLED = ConfigInterface::XML_PATH_ENABLED
 

Protected Attributes

 $_customerSession
 
 $_customerViewHelper
 
- Protected Attributes inherited from AbstractHelper
 $_moduleName
 
 $_request
 
 $_moduleManager
 
 $_logger
 
 $_urlBuilder
 
 $_httpHeader
 
 $_eventManager
 
 $_remoteAddress
 
 $urlEncoder
 
 $urlDecoder
 
 $scopeConfig
 
 $_cacheConfig
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractHelper
 _getRequest ()
 
 _getModuleName ()
 
 _getUrl ($route, $params=[])
 

Detailed Description

Contact base helper

Deprecated:
100.2.0
See also
\Magento\Contact\Model\ConfigInterface

Definition at line 21 of file Data.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\App\Helper\Context  $context,
\Magento\Customer\Model\Session  $customerSession,
CustomerViewHelper  $customerViewHelper 
)
Parameters
\Magento\Framework\App\Helper\Context$context
\Magento\Customer\Model\Session$customerSession
CustomerViewHelper$customerViewHelper

Definition at line 52 of file Data.php.

56  {
57  $this->_customerSession = $customerSession;
58  $this->_customerViewHelper = $customerViewHelper;
59  parent::__construct($context);
60  }

Member Function Documentation

◆ getPostValue()

getPostValue (   $key)

Get value from POST by key

Parameters
string$key
Returns
string

Definition at line 118 of file Data.php.

119  {
120  if (null === $this->postData) {
121  $this->postData = (array) $this->getDataPersistor()->get('contact_us');
122  $this->getDataPersistor()->clear('contact_us');
123  }
124 
125  if (isset($this->postData[$key])) {
126  return (string) $this->postData[$key];
127  }
128 
129  return '';
130  }

◆ isEnabled()

isEnabled ( )

Check if enabled

Returns
string|null
Deprecated:
100.2.0 use \Magento\Contact\Api\ConfigInterface::isEnabled() instead

Definition at line 68 of file Data.php.

69  {
70  return $this->scopeConfig->getValue(
71  self::XML_PATH_ENABLED,
72  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
73  );
74  }

Field Documentation

◆ $_customerSession

$_customerSession
protected

Definition at line 30 of file Data.php.

◆ $_customerViewHelper

$_customerViewHelper
protected

Definition at line 35 of file Data.php.

◆ XML_PATH_ENABLED

const XML_PATH_ENABLED = ConfigInterface::XML_PATH_ENABLED

Definition at line 23 of file Data.php.


The documentation for this class was generated from the following file: