We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5909966 commit 730781bCopy full SHA for 730781b
components/validator/introduction.rst
@@ -31,9 +31,13 @@ characters long::
31
32
use Symfony\Component\Validator\Validation;
33
use Symfony\Component\Validator\Constraints\Length;
34
+ use Symfony\Component\Validator\Constraints\NotBlank;
35
36
$validator = Validation::createValidator();
- $violations = $validator->validateValue('Bernhard', new Length(array('min' => 10)));
37
+ $violations = $validator->validate('Bernhard', array(
38
+ new Length(array('min' => 10)),
39
+ new NotBlank()
40
+ ));
41
42
if (0 !== count($violations)) {
43
// there are errors, now you can show them
0 commit comments