Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Avoid repeated information when creating a form type extension #22833

Closed
@javiereguiluz

Description

@javiereguiluz
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version -

If you follow this article https://symfony.com/doc/current/form/create_form_type_extension.html you'll see that:

  1. In the ImageTypeExtension class, you must define which type are you extending with the getExtendedType() method.
  2. When defining a service, you must repeat that information in the extended_type attribute of the form.type_extension tag.

I have two proposals:

  1. Why repeat the information in the tag? Please remove this requirement. Thanks!
  2. I guess there will be some reasons for this but, why must I define the extended type in the getExtendedType() method instead of just extending the class of that type?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions