Skip to content

Add doc for the checkHost email constraint (#1414) #1438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 14, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions reference/constraints/Email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cast to a string before being validated.
+----------------+---------------------------------------------------------------------+
| Options | - `message`_ |
| | - `checkMX`_ |
| | - `checkHost`_ |
+----------------+---------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Email` |
+----------------+---------------------------------------------------------------------+
Expand Down Expand Up @@ -46,17 +47,17 @@ Basic Usage
</property>
</class>
</constraint-mapping>

.. code-block:: php-annotations

// src/Acme/BlogBundle/Entity/Author.php
namespace Acme\BlogBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;

class Author
{
/**
/**
* @Assert\Email(
* message = "The email '{{ value }}' is not a valid email.",
* checkMX = true
Expand All @@ -83,4 +84,12 @@ checkMX
If true, then the `checkdnsrr`_ PHP function will be used to check the validity
of the MX record of the host of the given email.

.. _`checkdnsrr`: http://www.php.net/manual/en/function.checkdnsrr.php
checkHost
~~~~~~~~~

**type**: ``Boolean`` **default**: ``false``

If true, then the `checkdnsrr`_ PHP function will be used to check the validity
of the MX *or* the A *or* the AAAA record of the host of the given email.

.. _`checkdnsrr`: http://www.php.net/manual/en/function.checkdnsrr.php