Skip to content
Closed
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
11 changes: 6 additions & 5 deletions components/form/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -671,15 +671,16 @@ object::

// ...

// an array of FormError objects, but only errors attached to this form level (e.g. "global errors)
$errors = $form->getErrors();
// an array of FormError objects. Use $deep to include child errors too,
// $flatten to flatten the list of errors in case
$errors = $form->getErrors($deep = false, $flatten = true);

// you can cast the result as a readable string
$errors = (string) $form->getErrors();

// an array of FormError objects, but only errors attached to the "firstName" field
$errors = $form['firstName']->getErrors();

// a string representation of all errors of the whole form tree
$errors = $form->getErrorsAsString();

.. note::

If you enable the :ref:`error_bubbling <reference-form-option-error-bubbling>`
Expand Down