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 1
1
Cidr
2
- ==
2
+ ====
3
3
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.
8
12
9
13
========== ===================================================================
10
14
Applies to :ref: `property or method <validation-property-target >`
11
- Options - `groups `_
12
- - `message `_
13
- - `netmaskRangeViolationMessage `_
14
- - `payload `_
15
- - `version `_
16
15
Class :class: `Symfony\\ Component\\ Validator\\ Constraints\\ Cidr `
17
16
Validator :class: `Symfony\\ Component\\ Validator\\ Constraints\\ CidrValidator `
18
17
========== ===================================================================
@@ -153,3 +152,4 @@ of a variety of different values:
153
152
``all ``
154
153
Validates all CIDR formats
155
154
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
22
22
* :doc:`Regex </ reference/constraints/Regex> `
23
23
* :doc:`Hostname </ reference/constraints/Hostname> `
24
24
* :doc:`Ip </ reference/constraints/Ip> `
25
+ * :doc:`Cidr </ reference/constraints/Cidr> `
25
26
* :doc:`Json </ reference/constraints/Json> `
26
27
* :doc:`Uuid </ reference/constraints/Uuid> `
27
28
* :doc:`Ulid </ reference/constraints/Ulid> `
You can’t perform that action at this time.
0 commit comments