Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AuthenticationPopup.php
Go to the documentation of this file.
1 <?php
7 
10 
16 {
20  protected $jsLayout;
21 
25  private $serializer;
26 
33  public function __construct(
34  \Magento\Framework\View\Element\Template\Context $context,
35  array $data = [],
36  \Magento\Framework\Serialize\Serializer\Json $serializer = null
37  ) {
38  parent::__construct($context, $data);
39  $this->jsLayout = isset($data['jsLayout']) && is_array($data['jsLayout']) ? $data['jsLayout'] : [];
40  $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
41  ->get(\Magento\Framework\Serialize\Serializer\Json::class);
42  }
43 
47  public function getJsLayout()
48  {
49  return $this->serializer->serialize($this->jsLayout);
50  }
51 
57  public function getConfig()
58  {
59  return [
60  'autocomplete' => $this->escapeHtml($this->isAutocompleteEnabled()),
61  'customerRegisterUrl' => $this->escapeUrl($this->getCustomerRegisterUrlUrl()),
62  'customerForgotPasswordUrl' => $this->escapeUrl($this->getCustomerForgotPasswordUrl()),
63  'baseUrl' => $this->escapeUrl($this->getBaseUrl())
64  ];
65  }
66 
75  public function getSerializedConfig()
76  {
77  return $this->serializer->serialize($this->getConfig());
78  }
79 
85  private function isAutocompleteEnabled()
86  {
87  return $this->_scopeConfig->getValue(
90  ) ? 'on' : 'off';
91  }
92 
98  public function getBaseUrl()
99  {
100  return $this->_storeManager->getStore()->getBaseUrl();
101  }
102 
108  public function getCustomerRegisterUrlUrl()
109  {
110  return $this->getUrl('customer/account/create');
111  }
112 
119  {
120  return $this->getUrl('customer/account/forgotpassword');
121  }
122 }
const XML_PATH_ENABLE_AUTOCOMPLETE
Definition: Form.php:19
__construct(\Magento\Framework\View\Element\Template\Context $context, array $data=[], \Magento\Framework\Serialize\Serializer\Json $serializer=null)