8000 [Validator] added alpha3 option to country constraint · symfony/symfony-docs@bf65a90 · GitHub
[go: up one dir, main page]

Skip to content

Commit bf65a90

Browse files
committed
[Validator] added alpha3 option to country constraint
1 parent 111ae11 commit bf65a90

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

reference/constraints/Country.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Validates that a value is a valid `ISO 3166-1 alpha-2`_ country code.
77
Applies to :ref:`property or method <validation-property-target>`
88
Options - `groups`_
99
- `message`_
10+
- `alpha3`_
1011
- `payload`_
1112
Class :class:`Symfony\\Component\\Validator\\Constraints\\Country`
1213
Validator :class:`Symfony\\Component\\Validator\\Constraints\\CountryValidator`
@@ -78,6 +79,15 @@ Options
7879

7980
.. include:: /reference/constraints/_groups-option.rst.inc
8081

82+
alpha3
83+
~~~~~~
84+
85+
**type**: ``boolean`` **default**: ``false``
86+
87+
If this option is ``true``, then the constraint will valid the value as
88+
`ISO 3166-1 alpha-3`_ three-letter codes (e.g. France = ``FRA``) instead
89+
of the default `ISO 3166-1 alpha-2`_ two-letter codes (e.g. France = ``FR``).
90+
8191
message
8292
~~~~~~~
8393

@@ -96,3 +106,5 @@ Parameter Description
96106
.. include:: /reference/constraints/_payload-option.rst.inc
97107

98108
.. _`ISO 3166-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
109+
.. _`ISO 3166-1 alpha-3`: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Current_codes
110+

0 commit comments

Comments
 (0)
0