Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] Added getBlockPrefix() to ResolvedFormTypeInterface#16749

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Tobion merged 1 commit intosymfony:masterfromwebmozart:block-prefix-cleanup
Nov 29, 2015

Conversation

webmozart
Copy link
Contributor

QA
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

This is the follow-up PR to#16724.

If you call$form->getConfig()->getType(), all the methods of FormType should be usable. In that sense, ResolvedFormType is the developer-facing version of FormType.

It is true that the same could be achieved withgetInnerType(), but that method should be used in edge cases only as it clutters the code and makes it confusing to read:

$blockPrefix =$form->getConfig()->getType()->getInnerType()->getBlockPrefix();

@Tobion
Copy link
Contributor

Thank you@webmozart.

@TobionTobion merged commit7e89345 intosymfony:masterNov 29, 2015
Tobion added a commit that referenced this pull requestNov 29, 2015
…ce (webmozart)This PR was merged into the 3.0-dev branch.Discussion----------[Form] Added getBlockPrefix() to ResolvedFormTypeInterface| Q             | A| ------------- | ---| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -This is the follow-up PR to#16724.If you call `$form->getConfig()->getType()`, all the methods of FormType should be usable. In that sense, ResolvedFormType is the developer-facing version of FormType.It is true that the same could be achieved with `getInnerType()`, but that method should be used in edge cases only as it clutters the code and makes it confusing to read:```php$blockPrefix = $form->getConfig()->getType()->getInnerType()->getBlockPrefix();```Commits-------7e89345 [Form] Added getBlockPrefix() to ResolvedFormTypeInterface
@xabbuh
Copy link
Member

If you call$form->getConfig()->getType(), all the methods of FormType should be usable. In that sense, ResolvedFormType is the developer-facing version of FormType.

Would it make sense then to letResolvedFormTypeInterface extend theFormTypeInterface or also add theconfigureOptions() method to the interface?

@webmozart
Copy link
ContributorAuthor

@xabbuh Not really. ResolvedFormTypeInterface is justlike FormType, but not exactly the same, as it also contains references to the parent type and its type extensions. SogetParent() returns a ResolvedFormTypeInterface, while in FormType it returns a string.buildForm() builds the form, but also calls the parent and the extensions. AndconfigureOptions() shouldn't be added since that's whatgetOptionsResolver() is for, which makes sure to always return the same instance (for performance reasons).

@xabbuh
Copy link
Member

@webmozart I see, thanks for the explanation.

stof added a commit that referenced this pull requestDec 5, 2015
This PR was submitted for the master branch but it was merged into the 3.0 branch instead (closes#16752).Discussion----------[Form] document changes to form type interfaces| Q             | A| ------------- | ---| Fixed tickets |#13407,#16024,#16724,#16749| License       | MITCommits-------b297a0c [Form] document changes to form type interfaces
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@webmozart@Tobion@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp