Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Captcha.php
Go to the documentation of this file.
1 <?php
12 namespace Magento\Captcha\Block;
13 
19 {
25  protected $_captchaData = null;
26 
32  public function __construct(
33  \Magento\Framework\View\Element\Template\Context $context,
34  \Magento\Captcha\Helper\Data $captchaData,
35  array $data = []
36  ) {
37  $this->_captchaData = $captchaData;
38  parent::__construct($context, $data);
39  $this->_isScopePrivate = true;
40  }
41 
47  protected function _toHtml()
48  {
49  $blockPath = $this->_captchaData->getCaptcha($this->getFormId())->getBlockName();
50  $block = $this->getLayout()->createBlock($blockPath);
51  $block->setData($this->getData());
52  return $block->toHtml();
53  }
54 }
getData($key='', $index=null)
Definition: DataObject.php:119
$block
Definition: block.php:8
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Captcha\Helper\Data $captchaData, array $data=[])
Definition: Captcha.php:32