You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Size: { min: 120, max: 180, minMessage: You must be at least 120cm tall to enter, maxMessage: You cannot be taller than 180cm to enter }
34
+
- Size:
35
+
min: 120
36
+
max: 180
37
+
minMessage: You must be at least 120cm tall to enter
38
+
maxMessage: You cannot be taller than 180cm to enter
35
39
36
40
.. code-block:: php-annotations
37
41
@@ -41,7 +45,12 @@ the following:
41
45
class Participant
42
46
{
43
47
/**
44
-
* @Assert\Size(min = "120", max = "180", minMessage = "You must be at least 120cm tall to enter", maxMessage="You cannot be taller than 180cm to enter")
48
+
* @Assert\Size(
49
+
* min = "120",
50
+
* max = "180",
51
+
* minMessage = "You must be at least 120cm tall to enter",
52
+
* maxMessage="You cannot be taller than 180cm to enter"
- SizeLength: { min: 2, max: 50, minMessage: Firstname must be at least 2 characters length, maxMessage: Firstname cannot be longer than than 50 characters length }
34
+
firstName:
35
+
- SizeLength:
36
+
min: 2
37
+
max: 50
38
+
minMessage: Your first name must be at least 2 characters length
39
+
maxMessage: Your first name cannot be longer than than 50 characters length
36
40
37
41
.. code-block:: php-annotations
38
42
@@ -42,9 +46,14 @@ the following:
42
46
class Participant
43
47
{
44
48
/**
45
-
* @Assert\SizeLength(min = "2", max = "50", minMessage = "Firstname must be at least 2 characters length", maxMessage="Firstname cannot be longer than than 50 characters length")
49
+
* @Assert\SizeLength(
50
+
* min = "2",
51
+
* max = "50",
52
+
* minMessage = "Your first name must be at least 2 characters length",
53
+
* maxMessage="Your first name cannot be longer than than 50 characters length"
This required option is the "max" length value. Validation will fail if the given
67
-
value's length is **less** than this max value.
76
+
value's length is **greater** than this max value.
68
77
69
78
charset
70
79
~~~~~~~
71
80
72
81
**type**: ``string`` **default**: ``UTF-8``
73
82
74
-
Charset to be used when computing value's length per the `grapheme_strlen`_ PHP function, fallback to the `mb_strlen`_ PHP function, fallback to the `strlen`_ PHP function.
83
+
The charset to be used when computing value's length. The `grapheme_strlen`_ PHP
84
+
function is used if available. If not, the the `mb_strlen`_ PHP function
85
+
is used if available. If neither are available, the `strlen`_ PHP function
0 commit comments