diff --git a/book/validation.rst b/book/validation.rst index ac4bacfdbd3..a600ac6f6c8 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -117,7 +117,9 @@ constraints. If validation fails, a non-empty list of errors (class :class:`Symfony\\Component\\Validator\\ConstraintViolationList`) is returned. Take this simple example from inside a controller: - // ... +.. code-block:: php + + //... use Symfony\Component\HttpFoundation\Response; use Acme\BlogBundle\Entity\Author; @@ -142,7 +144,7 @@ returned. Take this simple example from inside a controller: return new Response('The author is valid! Yes!'); } - + If the ``$name`` property is empty, you will see the following error message: