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-captcha
Block
Captcha
DefaultCaptcha.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Captcha\Block\Captcha
;
7
11
class
DefaultCaptcha
extends
\Magento\Framework\View\Element\Template
12
{
16
protected
$_template
=
'Magento_Captcha::default.phtml'
;
17
21
protected
$_captcha
;
22
26
protected
$_captchaData
;
27
33
public
function
__construct
(
34
\
Magento
\Framework\View\Element\Template\
Context
$context,
35
\
Magento
\
Captcha
\Helper\Data $captchaData,
36
array
$data
= []
37
) {
38
parent::__construct($context,
$data
);
39
$this->_captchaData = $captchaData;
40
}
41
47
public
function
getTemplate
()
48
{
49
return
$this->getIsAjax() ?
''
:
$this->_template
;
50
}
51
57
public
function
getRefreshUrl
()
58
{
59
$store
= $this->_storeManager->getStore();
60
return
$store
->getUrl(
'captcha/refresh'
, [
'_secure'
=>
$store
->isCurrentlySecure()]);
61
}
62
68
protected
function
_toHtml
()
69
{
70
if
($this->
getCaptchaModel
()->isRequired()) {
71
$this->
getCaptchaModel
()->generate();
72
return
parent::_toHtml();
73
}
74
return
''
;
75
}
76
82
public
function
getCaptchaModel
()
83
{
84
return
$this->_captchaData->getCaptcha($this->getFormId());
85
}
86
}
Magento\Captcha\Block\Captcha
Definition:
DefaultTest.php:6
Magento\Captcha\Block\Captcha\DefaultCaptcha\getTemplate
getTemplate()
Definition:
DefaultCaptcha.php:47
Magento\Captcha\Block\Captcha\DefaultCaptcha\$_template
$_template
Definition:
DefaultCaptcha.php:16
Magento\Captcha\Block\Captcha\DefaultCaptcha\$_captchaData
$_captchaData
Definition:
DefaultCaptcha.php:26
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Captcha\Block\Captcha\DefaultCaptcha\getCaptchaModel
getCaptchaModel()
Definition:
DefaultCaptcha.php:82
Magento\Captcha\Block\Captcha\DefaultCaptcha\getRefreshUrl
getRefreshUrl()
Definition:
DefaultCaptcha.php:57
Magento
Magento\Framework\View\Element\Template
Definition:
Template.php:32
Magento\Captcha\Block\Captcha\DefaultCaptcha
Definition:
DefaultCaptcha.php:11
$store
$store
Definition:
payment_configuration_rollback.php:33
Magento\Captcha\Block\Captcha
Definition:
Captcha.php:18
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Captcha\Block\Captcha\DefaultCaptcha\__construct
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Captcha\Helper\Data $captchaData, array $data=[])
Definition:
DefaultCaptcha.php:33
Magento\Captcha\Block\Captcha\DefaultCaptcha\$_captcha
$_captcha
Definition:
DefaultCaptcha.php:21
Magento\Captcha\Block\Captcha\DefaultCaptcha\_toHtml
_toHtml()
Definition:
DefaultCaptcha.php:68