8000 Documented the checkDNS option of the Url validator by javiereguiluz · Pull Request #5426 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Documented the checkDNS option of the Url validator #5426

8000
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

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixed the order of the examples
  • Loading branch information
javiereguiluz committed Jun 24, 2015
commit a2fd9ef3439c057d2b8a9cf2f5b208a13ae56ff2
58 changes: 29 additions & 29 deletions reference/constraints/Url.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ This message is shown if the URL is invalid.

.. configuration-block::

.. code-block:: yaml

# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Author:
properties:
bioUrl:
- Url: ~
message: The url "{{ value }}" is not a valid url.

.. code-block:: php-annotations

// src/Acme/BlogBundle/Entity/Author.php
Expand All @@ -112,6 +103,15 @@ This message is shown if the URL is invalid.
protected $bioUrl;
}

.. code-block:: yaml

# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Author:
properties:
bioUrl:
- Url: ~
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and here :)

message: The url "{{ value }}" is not a valid url.

.. code-block:: xml

<!-- src/Acme/BlogBundle/Resources/config/validation.xml -->
Expand Down Expand Up @@ -158,15 +158,6 @@ the ``ftp://`` type URLs to be valid, redefine the ``protocols`` array, listing

.. configuration-block::

.. code-block:: yaml

# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Author:
properties:
bioUrl:
- Url: ~
protocols: [http, https, ftp]

.. code-block:: php-annotations

// src/Acme/BlogBundle/Entity/Author.php
Expand All @@ -184,6 +175,15 @@ the ``ftp://`` type URLs to be valid, redefine the ``protocols`` array, listing
protected $bioUrl;
}

.. code-block:: yaml

# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Author:
properties:
bioUrl:
- Url: ~
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here (and I prefer - Url: { protocols: [http, https, ftp] })

protocols: [http, https, ftp]

.. code-block:: xml

<!-- src/Acme/BlogBundle/Resources/config/validation.xml -->
Expand Down Expand Up @@ -234,17 +234,6 @@ option to ``true``:

.. configuration-block::

.. code-block:: yaml

# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Author:
properties:
bioUrl:
- Url: ~
message: The url "{{ value }}" is not a valid url.
protocols: [http, https]
checkDNS: true

.. code-block:: php-annotations

// src/Acme/BlogBundle/Entity/Author.php
Expand All @@ -264,6 +253,17 @@ option to ``true``:
protected $bioUrl;
}

.. code-block:: yaml

# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Author:
properties:
bioUrl:
- Url: ~
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ~ is wrong (as the options are defined below)

message: The url "{{ value }}" is not a valid url.
protocols: [http, https]
checkDNS: true

.. code-block:: xml

<!-- src/Acme/BlogBundle/Resources/config/validation.xml -->
Expand Down
0