Skip to content

[Form] explain how to use getOrigin() #17670

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
alexislefebvre opened this issue Jan 6, 2023 · 1 comment
Closed

[Form] explain how to use getOrigin() #17670

alexislefebvre opened this issue Jan 6, 2023 · 1 comment
Labels
Form hasPR A Pull Request has already been submitted for this issue.

Comments

@alexislefebvre
Copy link
Contributor

alexislefebvre commented Jan 6, 2023

getOrigin() is mentioned in https://symfony.com/doc/5.4/components/form.html#accessing-form-errors

This documentation is evasive, how people should use getOrigin()? I tried and failed, see #17669

Source:

// a FormErrorIterator instance in a flattened structure
// use getOrigin() to determine the form causing the error
$errors = $form->getErrors(true);

@carsonbot carsonbot added the Form label Jan 6, 2023
@xabbuh
Copy link
Member

xabbuh commented Jan 6, 2023

Maybe we should remove that sentence. I am not sure it really adds any value.

@OskarStark OskarStark changed the title [Form] explain how to use getOrigin() [Form] explain how to use getOrigin() Jan 10, 2023
@xabbuh xabbuh added the hasPR A Pull Request has already been submitted for this issue. label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Form hasPR A Pull Request has already been submitted for this issue.
Projects
None yet
Development

No branches or pull requests

3 participants