'Champs obligatoire'], [['name', 'email'], 'required', 'message' => 'Champs obligatoire', 'when' => function($model) use($userManager) { return $userManager->isCurrentGuest(); }], ['email', 'email', 'message' => 'Email incorrect'], ['isTest', 'string'], ['verifyCode', 'captcha', 'message' => 'Veuillez recopier le code de vérification', 'when' => function($model) use($userManager) { return $model->isTest != 'isTest' && $userManager->isCurrentGuest(); }], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'name' => 'Nom', 'email' => 'Email', 'message' => 'Message', 'verifyCode' => 'Code de vérification', ]; } }