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

Skip to content

Commit bb8f44f

Browse files
committed
feature #12857 [Validator] added alpha3 option to country constraint (maxperrimond)
This PR was merged into the master branch. Discussion ---------- [Validator] added alpha3 option to country constraint <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Documentation part of symfony/symfony#35116 Commits ------- 912a217 [Validator] added alpha3 option to country constraint
2 parents 4a06796 + 912a217 commit bb8f44f

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