8000 describe how to access form errors · symfony/symfony-docs@4221db8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4221db8

Browse files
committed
describe how to access form errors
1 parent de286e2 commit 4221db8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/form/introduction.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,13 @@ object::
687687
errors from that field. However, there is no way to determine which field
688688
an error was originally attached to.
689689

690+
.. note::
691+
692+
Unless you enable the :ref:`error_bubbling <reference-form-option-error-bubbling>`
693+
option on a particular child form, ``getErrors()`` only returns the errors
694+
of the form it is accessed on. For debugging purposes, you can use the :method:`Symfony\\Component\\Form\\Form::getErrorsAsString` method which
695+
returns a string representation of all errors of the whole form tree.
696+
690697
.. _Packagist: https://packagist.org/packages/symfony/form
691698
.. _Twig: http://twig.sensiolabs.org
692699
.. _`Twig Configuration`: http://twig.sensiolabs.org/doc/intro.html

0 commit comments

Comments
 (0)
0