How to Add Captcha Widget ========================= In order to add the Yii 2 captcha widget you need to: - Override the Form class you wish to add the captcha rule to - Override the view where the form is rendering - Add captcha action to a controller - Configure Module and Application Override the Form ----------------- For the sake of the example, we are going to override the `Da\User\Form\RecoveryForm` class: ```php namespace app\forms; class RecoveryForm extends Da\User\Form\RecoveryForm { public $captcha; public function rules() { $rules = parent::rules(); $rules[] = ['captcha', 'required']; $rules[] = ['captcha', 'captcha']; return $rules; } } ``` Overriding the View ------------------- Create a new file and name it `request.php` and add it in `@app/views/user/recovery`. Add the captcha widget to it: ```php title = Yii::t('usuario', 'Recover your password'); $this->params['breadcrumbs'][] = $this->title; ?>