public $captcha;Trong đó captchaAction là đường dẫn dùng để xác thực captcha, có thể thay đổi tùy theo bạn muốn đặt xác thực captcha ở controller nào. Mặc định là SiteController.
...
['captcha', 'required'],
['captcha', 'captcha', 'captchaAction'=>'/site/captcha'],
2. View
<?= $form->field($model, 'captcha')->widget(Captcha::className(), ['captchaAction'=>'/site/captcha']) ?>
3. Site Controller
public function actions()
{
return [
'captcha' => [
'class' => 'yii\captcha\CaptchaAction',
],
];
}