-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
FormTypeInterface::getName() is deprecated #5588
Comments
Given that Symfony 2.8 is designed for PHP 5.3.9 and up, docs should display both the short |
Indeed, that's a good hint, Javier! |
…ponent (hiddewie) This PR was merged into the 2.8 branch. Discussion ---------- Updated form aliases to FQCNs for forms in book and component | Q | A |------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.8+ | Fixed tickets | #5588 For the 3.0 branch, all FQCNs should be updated to use the `::class` constant. Commits ------- e103627 Fixed wrong indendation f8b080d Found more places which use old form types 3237a34 Updated form constant usage 3ab3830 Fixed PHP 5.5+ reference in form component 291a42a Fixed removed XML tag in form book 0820e69 Updated form aliases to FQCNs for forms in book and component
Please see #5909, for the second set of huge changes for this :) |
This PR was merged into the 2.8 branch. Discussion ---------- More 2.8 form updates | Q | A |------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.8+ | Fixed tickets | #5588 This is addition to what was done in #5834. These changes are HUGE, so if anyone can review this for copy-paste changes or other mistakes, that would be awesome. Also, if you can think of any other things to search for the the code base and are able to find MORE instances, let me know. Commits ------- d131449 several other tweaks feb68dd Completely updating the form type reference section for the text -> TextType changes 832a12a fixing build error 3117df5 Another huge batch of changes for the form type changes in 2.8
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. |
@pfleu I think you are confusing the form name and the form type name |
@stof Thanks for your answer. I wanted to change what is now called blockPrefix. I had an answer on StackOverflow, it looks like |
@pfleu your question is logical. But the block prefix is not the same as the name, note that the usage of the name has been deprecated in many function call in favor of the FQCN. You can also change the block prefix used in templates dynamically by using the option Hope that helps, cheers! |
@HeahDude Thanks for your explanations! |
As of Symfony 2.8, implementing the
getName()
method of theFormTypeInterface()
is deprecated. Instead, form types should be referenced by their FQCN (which is quite easy as PHP supports theclass
constant since 5.5). Additionally, you should now also not use thealias
attribute anymore when tagging your services as a form type using theform.type
tag.More detailed information and examples can be found in the code PR (see symfony/symfony#15079) which has just been merged.
The text was updated successfully, but these errors were encountered: