Created
May 29, 2020 07:20
-
-
Save Anubarak/090a333d8c01b1567f48b99c1be1259d to your computer and use it in GitHub Desktop.
Revisions
-
Anubarak created this gist
May 29, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ $model = new DynamicModel($request->getBodyParams(), [ [ ['firstname', 'lastname', 'mail', 'privacy'], 'required', 'message' => Craft::t('site', "Folgendes Feld Fehlt: {attribute}") ] ]); $model->addRule('minEntryTimeMethod', static function() use ($model){ if (/* kleiner als 3s */) { $model->addError('title', "Sie haben zu schnell abgesendet"); } }); $model->validate(); $model->getErrors();