From 6ba0cb58d07a843bfd46ba5a7f1d3798b83637e0 Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Fri, 6 Jan 2023 14:15:33 +0100 Subject: [PATCH] form: explain how to use getOrigin() --- components/form.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/form.rst b/components/form.rst index d4fdab0a7ec..de229a0378d 100644 --- a/components/form.rst +++ b/components/form.rst @@ -753,7 +753,8 @@ method to access the list of errors. It returns a $errors = $form['firstName']->getErrors(); // a FormErrorIterator instance in a flattened structure - // use getOrigin() to determine the form causing the error + // use getOrigin() on a child to determine the form causing the error + // e.g. $form->getErrors(true)[0]->getOrigin(); $errors = $form->getErrors(true); // a FormErrorIterator instance representing the form tree structure