Skip to content

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

Closed
@alexislefebvre

Description

@alexislefebvre

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FormhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions