File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 11Cidr
2- ==
2+ ====
33
4- Validates that a value is a valid CIDR notation. By default, this will validate
5- the CIDR's IP and netmask both for version 4 and version 6, with the option of allowing
6- only one type of IP version to be valid. It also supports a minimum and maximum range
7- constraint in which the value of the netmask is valid.
4+ .. versionadded :: 5.4
5+
6+ The ``Cidr `` constraint was introduced in Symfony 5.4.
7+
8+ Validates that a value is a valid `CIDR `_ (Classless Inter-Domain Routing) notation.
9+ By default, this will validate the CIDR's IP and netmask both for version 4 and 6,
10+ with the option of allowing only one type of IP version to be valid. It also supports
11+ a minimum and maximum range constraint in which the value of the netmask is valid.
812
913========== ===================================================================
1014Applies to :ref: `property or method <validation-property-target >`
11- Options - `groups `_
12- - `message `_
13- - `netmaskRangeViolationMessage `_
14- - `payload `_
15- - `version `_
1615Class :class: `Symfony\\ Component\\ Validator\\ Constraints\\ Cidr `
1716Validator :class: `Symfony\\ Component\\ Validator\\ Constraints\\ CidrValidator `
1817========== ===================================================================
@@ -153,3 +152,4 @@ of a variety of different values:
153152``all ``
154153 Validates all CIDR formats
155154
155+ .. _`CIDR` : https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ String Constraints
2222* :doc:`Regex </ reference/constraints/Regex> `
2323* :doc:`Hostname </ reference/constraints/Hostname> `
2424* :doc:`Ip </ reference/constraints/Ip> `
25+ * :doc:`Cidr </ reference/constraints/Cidr> `
2526* :doc:`Json </ reference/constraints/Json> `
2627* :doc:`Uuid </ reference/constraints/Uuid> `
2728* :doc:`Ulid </ reference/constraints/Ulid> `
You can’t perform that action at this time.
0 commit comments