39 ->get(\
Magento\Framework\Serialize\Serializer\Json::class);
40 parent::__construct($context);
48 $formId = $this->_request->getPost(
'formId');
49 if (
null === $formId) {
51 $content = $this->_request->getContent();
57 $captchaModel = $this->captchaHelper->getCaptcha($formId);
58 $captchaModel->generate();
60 $block = $this->_view->getLayout()->createBlock($captchaModel->getBlockName());
61 $block->setFormId($formId)->setIsAjax(
true)->toHtml();
62 $this->_response->representJson($this->serializer->serialize([
'imgSrc' => $captchaModel->getImgSrc()]));
63 $this->_actionFlag->set(
'', self::FLAG_NO_POST_DISPATCH,
true);
__construct(Context $context, \Magento\Captcha\Helper\Data $captchaHelper, \Magento\Framework\Serialize\Serializer\Json $serializer=null)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]