Skip to content

Commit d9cec34

Browse files
committed
Merge pull request #1438 from Dinduks/add_doc_for_checkhost_validation
Add doc for the checkHost email constraint (#1414)
2 parents 20549d6 + 3be021b commit d9cec34

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

reference/constraints/Email.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ cast to a string before being validated.
99
+----------------+---------------------------------------------------------------------+
1010
| Options | - `message`_ |
1111
| | - `checkMX`_ |
12+
| | - `checkHost`_ |
1213
+----------------+---------------------------------------------------------------------+
1314
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Email` |
1415
+----------------+---------------------------------------------------------------------+
@@ -46,17 +47,17 @@ Basic Usage
4647
</property>
4748
</class>
4849
</constraint-mapping>
49-
50+
5051
.. code-block:: php-annotations
5152
5253
// src/Acme/BlogBundle/Entity/Author.php
5354
namespace Acme\BlogBundle\Entity;
54-
55+
5556
use Symfony\Component\Validator\Constraints as Assert;
5657
5758
class Author
5859
{
59-
/**
60+
/**
6061
* @Assert\Email(
6162
* message = "The email '{{ value }}' is not a valid email.",
6263
* checkMX = true
@@ -83,4 +84,12 @@ checkMX
8384
If true, then the `checkdnsrr`_ PHP function will be used to check the validity
8485
of the MX record of the host of the given email.
8586

86-
.. _`checkdnsrr`: http://www.php.net/manual/en/function.checkdnsrr.php
87+
checkHost
88+
~~~~~~~~~
89+
90+
**type**: ``Boolean`` **default**: ``false``
91+
92+
If true, then the `checkdnsrr`_ PHP function will be used to check the validity
93+
of the MX *or* the A *or* the AAAA record of the host of the given email.
94+
95+
.. _`checkdnsrr`: http://www.php.net/manual/en/function.checkdnsrr.php

0 commit comments

Comments
 (0)