D
D
dev4002016-11-09 07:15:17
Yii
dev400, 2016-11-09 07:15:17

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('Нажмите на картинку, чтобы обновить.') ?>

But I still get the exception
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

1 answer(s)
E
enchikiben, 2016-11-09
@dev400

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 question

Ask a Question

731 491 924 answers to any question