models/ContactForm.php
/**
     * @return array the validation rules.
     */
@return array the validation rules.
@return array the validation rules .
public function rules()
    {
        return [
            [['name', 'email', 'text'], 'required'],
            ['email', 'email'],
            [['reCaptcha'], ReCaptchaValidator2::class, 'skipOnEmpty' => YII_DEBUG ? true : false,  'uncheckedMessage' => Yii::t('app', 'Please confirm that you are not a bot.')],
        ];
    }
public function rules ( ) { return [ [ [ 'name' , 'email' , 'text' ] , 'required' ] , [ 'email' , 'email' ] , [ [ 'reCaptcha' ] , ReCaptchaValidator2 :: class , 'skipOnEmpty' => YII_DEBUG ? true : false , 'uncheckedMessage' => Yii :: t ( 'app' , 'Please confirm that you are not a bot.' ) ] , ] ; }
@return array the validation rules.
@return array the validation rules .
// name, email and body are required // email has to be a valid email address // verifyCode needs to be entered correctly