From 647d2b53b805945261eb718bce28a8843ddf1486 Mon Sep 17 00:00:00 2001 From: Stefano Sala Date: Tue, 28 Oct 2014 15:41:53 +0100 Subject: [PATCH] [Form] Removed deprecated getErrorAsString doc Explained options for getErrors method --- components/form/introduction.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/form/introduction.rst b/components/form/introduction.rst index 2cd6ad86a19..36c892228c0 100644 --- a/components/form/introduction.rst +++ b/components/form/introduction.rst @@ -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 `