Answer the question
In order to leave comments, you need to log in
How to change captcha action in yii2?
By default it is in 'site/captcha', but there is a need to get it out of 'user/captcha'.
I do it like this:
<?= $form->field($model, 'verifyCode')->widget(
yii\captcha\Captcha::className(),
[
'captchaAction' => 'user/captcha',
'template' => '<div class="row"><div class="col-xs-3">{image}</div><div class="col-xs-4">{input}</div></div>'
]
)->hint('Нажмите на картинку, чтобы обновить.') ?>
Exception (Invalid Configuration) 'yii\base\InvalidConfigException' with message 'Invalid CAPTCHA action ID: site/captcha'
Answer the question
In order to leave comments, you need to log in
Have you configured it in your controller? In the model (['verifyCode', 'captcha','captchaAction'=>'user/captcha'])?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question