Skip to content

[Form] Ability to extend multiple form types with one type extension #27906

Closed
@xabbuh

Description

@xabbuh

Currently, it is only possible to extend a single form type (and all its children) with a single form type extension. If you want to add an additional option to, for example, TextType and ChoiceType you will either have to create two extension classes or create an extension for the base FormType and thus adding the option to most other form types too.

@HeahDude and me discovered that we need to discuss if we want to support these uses cases in Form component before we can make a final decision on the implementation in #24530. Otherwise, we risk to deprecate the getExtendedType() method of the FormTypeExtensionInterface in favour of a solution which would then in turn be deprecated again in one of the next minor releases just to support the extension of multiple form types. That wouldn't be good DX-wise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FormRFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions