|
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 |