Skip to content

[Form] Removed deprecated getErrorAsString doc #4385

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
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