Skip to content

FormTypeInterface::getName() is deprecated #5588

@xabbuh

Description

@xabbuh
Member

As of Symfony 2.8, implementing the getName() method of the FormTypeInterface() is deprecated. Instead, form types should be referenced by their FQCN (which is quite easy as PHP supports the class constant since 5.5). Additionally, you should now also not use the alias attribute anymore when tagging your services as a form type using the form.type tag.

More detailed information and examples can be found in the code PR (see symfony/symfony#15079) which has just been merged.

Activity

added this to the 2.8 milestone on Aug 1, 2015
javiereguiluz

javiereguiluz commented on Aug 1, 2015

@javiereguiluz
Member

Given that Symfony 2.8 is designed for PHP 5.3.9 and up, docs should display both the short ::class examples and the long/verbose alternatives for 5.3 and 5.4.

xabbuh

xabbuh commented on Aug 1, 2015

@xabbuh
MemberAuthor

Indeed, that's a good hint, Javier!

added
hasPRA Pull Request has already been submitted for this issue.
on Nov 22, 2015
added a commit that references this issue on Nov 27, 2015
weaverryan

weaverryan commented on Nov 27, 2015

@weaverryan
Member

Please see #5909, for the second set of huge changes for this :)

added a commit that references this issue on Nov 30, 2015
pfleu

pfleu commented on May 3, 2016

@pfleu
Contributor

Does this mean you can't customize a form's name anymore ? I have custom prototype entry_rows for some collections that I would need to use from different forms, so I need to change the form's name.

8 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FormactionableClear and specific issues ready for anyone to take them.hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @javiereguiluz@weaverryan@stof@xabbuh@HeahDude

        Issue actions

          FormTypeInterface::getName() is deprecated · Issue #5588 · symfony/symfony-docs