@@ -7,7 +7,8 @@ cast to a string before being validated.
7
7
+----------------+---------------------------------------------------------------------+
8
8
| Applies to | :ref: `property or method <validation-property-target >` |
9
9
+----------------+---------------------------------------------------------------------+
10
- | Options | - `strict `_ |
10
+ | Options | - `profile `_ |
11
+ | | - `strict `_ |
11
12
| | - `message `_ |
12
13
| | - `checkMX `_ |
13
14
| | - `checkHost `_ |
@@ -91,14 +92,41 @@ Basic Usage
91
92
Options
92
93
-------
93
94
95
+ .. versionadded :: 3.1
96
+ The ``profile `` option was added in Symfony 3.1
97
+
98
+ profile
99
+ ~~~~~~~
100
+
101
+ **type **: ``string `` **default **: ``basic ``
102
+
103
+ This option is used to specify exactly which type of email validation should
104
+ be performed. It can be set to one of the following values:
105
+
106
+ ``basic ``
107
+ Validation will occur against a simple regular expression.
108
+ ``html5 ``
109
+ Validation will occur against the regular expression defined in
110
+ the `HTML5 spec `_.
111
+ ``rfc ``
112
+ The `egulias/email-validator `_ library will perform an RFC-compliant
113
+ validation in non-strict mode. If any warning messages regarding
114
+ unusual/deprecated email address features are raised during validation,
115
+ they will not prevent an otherwise-valid email from being marked as
116
+ invalid.
117
+ ``rfc-no-warn ``
118
+ The `egulias/email-validator `_ library will perform an RFC-compliant
119
+ validation in strict mode. If any warning messages regarding
120
+ unusual/deprecated email address features are raised during validation,
121
+ the email address will be considered invalid.
122
+
94
123
strict
95
124
~~~~~~
96
125
97
126
**type **: ``boolean `` **default **: ``false ``
98
127
99
- When false, the email will be validated against a simple regular expression.
100
- If true, then the `egulias/email-validator `_ library is required to perform
101
- an RFC compliant validation.
128
+ DEPRECATED. When true, the email validator will use the strict
129
+ 'rfc-no-warn' profile.
102
130
103
131
message
104
132
~~~~~~~
@@ -127,3 +155,5 @@ of the given email.
127
155
.. include :: /reference/constraints/_payload-option.rst.inc
128
156
129
157
.. _egulias/email-validator : https://packagist.org/packages/egulias/email-validator
158
+
159
+ .. _HTML5 spec : https://www.w3.org/TR/html-markup/datatypes.html#form.data.emailaddress-def
0 commit comments