Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit07d4bf9

Browse files
committed
[Validator] Html5 Email Validation
Add documentation about the new mode parameter. Adds descriptions forthe 'loose', 'strict', and 'html5' options.
1 parent0561864 commit07d4bf9

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

‎email/testing.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ Problem: The Collector Object Is ``null``
7373
The email collector is only available when the profiler is enabled and collects
7474
information, as explained in:doc:`/testing/profiling`.
7575

76-
Problem: The Collector Doesn't Contain theE-Mail
77-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76+
Problem: The Collector Doesn't Contain theEmail
77+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7878

7979
If a redirection is performed after sending the email (for example when you send
8080
an email after a form is processed and before redirecting to another page), make

‎reference/constraints/Email.rst‎

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cast to a string before being validated.
77
+----------------+---------------------------------------------------------------------+
88
| Applies to|:ref:`property or method<validation-property-target>`|
99
+----------------+---------------------------------------------------------------------+
10-
| Options| - `strict`_|
10+
| Options| - `mode`_|
1111
|| - `message`_|
1212
|| - `checkMX`_|
1313
|| - `checkHost`_|
@@ -91,14 +91,34 @@ Basic Usage
9191
Options
9292
-------
9393

94+
mode
95+
~~~~
96+
97+
**type**: ``string`` **default**: ``loose``
98+
99+
This option is optional and defines the pattern the email address is validated against.
100+
Valid values are:
101+
102+
* ``loose``
103+
* ``strict``
104+
* ``html5``
105+
106+
loose
107+
.....
108+
109+
A simple regular expression. Allows all values with an "@" symbol in, and a "."
110+
in the second host part of the email address.
111+
94112
strict
95-
~~~~~~
113+
......
96114

97-
**type**: ``boolean`` **default**: ``false``
115+
Uses the `egulias/email-validator`_ library to perform an RFC compliant
116+
validation. You will need to install that library to use this mode.
117+
118+
html5
119+
.....
98120

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.
121+
This matches the pattern used for the `HTML5 email input element`_.
102122

103123
message
104124
~~~~~~~
@@ -127,3 +147,4 @@ of the given email.
127147
..include::/reference/constraints/_payload-option.rst.inc
128148

129149
.. _egulias/email-validator:https://packagist.org/packages/egulias/email-validator
150+
.. _HTML5 email input element:https://www.w3.org/TR/html5/sec-forms.html#email-state-typeemail

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp