Skip to content

Commit

Permalink
Updated validations
Browse files Browse the repository at this point in the history
  • Loading branch information
kicaj authored Jan 28, 2020
1 parent d693559 commit 722c0df
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions en/core-libraries/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,8 @@ a simple contact form would look like::

public function validationDefault(Validator $validator): Validator
{
$validator->add('name', 'length', [
'rule' => ['minLength', 10],
'message' => 'A name is required'
])->add('email', 'format', [
'rule' => 'email',
'message' => 'A valid email address is required',
]);
$validator->minLength('name', 10)
->email('email');

return $validator;
}
Expand Down

0 comments on commit 722c0df

Please sign in to comment.