Skip to content

Commit 3525dd7

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: consider "allowEmptyString" option in example
2 parents 934600b + 26228a1 commit 3525dd7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

reference/constraints/Length.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ and "50", you might add the following:
4242
* min = 2,
4343
* max = 50,
4444
* minMessage = "Your first name must be at least {{ limit }} characters long",
45-
* maxMessage = "Your first name cannot be longer than {{ limit }} characters"
45+
* maxMessage = "Your first name cannot be longer than {{ limit }} characters",
46+
* allowEmptyString = false
4647
* )
4748
*/
4849
protected $firstName;
@@ -59,6 +60,7 @@ and "50", you might add the following:
5960
max: 50
6061
minMessage: 'Your first name must be at least {{ limit }} characters long'
6162
maxMessage: 'Your first name cannot be longer than {{ limit }} characters'
63+
allowEmptyString: false
6264
6365
.. code-block:: xml
6466
@@ -79,6 +81,7 @@ and "50", you might add the following:
7981
<option name="maxMessage">
8082
Your first name cannot be longer than {{ limit }} characters
8183
</option>
84+
<option name="allowEmptyString">false</option>
8285
</constraint>
8386
</property>
8487
</class>
@@ -101,6 +104,7 @@ and "50", you might add the following:
101104
'max' => 50,
102105
'minMessage' => 'Your first name must be at least {{ limit }} characters long',
103106
'maxMessage' => 'Your first name cannot be longer than {{ limit }} characters',
107+
'allowEmptyString' => false,
104108
]));
105109
}
106110
}

0 commit comments

Comments
 (0)