From 4221db82d872d63525cdbb6bfe57e0c76fd4bb25 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 23 Aug 2014 10:28:59 +0200 Subject: [PATCH] describe how to access form errors --- components/form/introduction.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/form/introduction.rst b/components/form/introduction.rst index 2cd6ad86a19..8f090568b77 100644 --- a/components/form/introduction.rst +++ b/components/form/introduction.rst @@ -687,6 +687,13 @@ object:: errors from that field. However, there is no way to determine which field an error was originally attached to. +.. note:: + + Unless you enable the :ref:`error_bubbling ` + option on a particular child form, ``getErrors()`` only returns the errors + of the form it is accessed on. For debugging purposes, you can use the :method:`Symfony\\Component\\Form\\Form::getErrorsAsString` method which + returns a string representation of all errors of the whole form tree. + .. _Packagist: https://packagist.org/packages/symfony/form .. _Twig: http://twig.sensiolabs.org .. _`Twig Configuration`: http://twig.sensiolabs.org/doc/intro.html