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]renderForm() method is deprecated#16948

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

Conversation

@mdoutreluingne
Copy link
Contributor

Fixes#16942

{# form is a variable passed from the controller via either
$this->renderForm('...', ['form' => $form])
$this->render('...', ['form' => $form])
or $this->render('...', ['form' => $form->createView()]) #}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This line unfortunately won't work the samesymfony/symfony#46854 (comment). We need to be careful.

I propose to keep this PR open until I (or anyone) try to tackle this in core.

Copy link
ContributorAuthor

@mdoutreluingnemdoutreluingneJul 7, 2022
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, I created this PR because currently in 6.2 therenderForm method is obsolete (so the documentation is acutely wrong). This branch is still under development and can therefore indeed be further modified. If you modify this method, don't forget to ping me so that I can close this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Note that both methods also weren't doing the same thing before this change. So I don't see this change blocking this PR.

forms.rst Outdated
In versions prior to Symfony 5.3, controllers used the method
``$this->render('...', ['form' => $form->createView()])`` to render the form.
The ``renderForm()`` method abstracts this logic and it also sets the 422 HTTP
The ``render()`` method abstracts this logic and it also sets the 422 HTTP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It may not (see my comment above).

@HeahDude
Copy link
Contributor

Thank you@mdoutreluingne for that PR.

@javiereguiluz
Copy link
Member

Just checking: are we still waiting for some code changes before finishing this PR? Thanks!

@HeahDude
Copy link
Contributor

Yes, I'll ping when there will be an update :).

@HeahDude
Copy link
Contributor

Minor update: I've openedsymfony/symfony#47600, let's see how it goes.

@wouterjwouterjforce-pushed therenderform-function-deprec branch froma8a24f6 to0c39fafCompareSeptember 20, 2022 12:22
wouterj added a commit that referenced this pull requestSep 20, 2022
…ngne)This PR was merged into the 6.2 branch.Discussion----------[Form] `renderForm()` method is deprecatedFixes#16942Commits-------0c39faf Deprecate `renderForm()`
@wouterj
Copy link
Member

Thanks@mdoutreluingne for writing up the documentation for this change!

I've added some changes to your commit, to be more clear about the current situation and the differences between passing$form and$form->createView(). Unfortunately, GitHub does not correctly show the changes. You can view the new commit (which was merged) here:0c39faf

HeahDude and mdoutreluingne reacted with thumbs up emoji

@mdoutreluingnemdoutreluingne deleted the renderform-function-deprec branchSeptember 20, 2022 19:00
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@wouterjwouterjwouterj left review comments

@xabbuhxabbuhAwaiting requested review from xabbuh

+1 more reviewer

@HeahDudeHeahDudeHeahDude left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

[FrameworkBundle] MakeAbstractController::render() able to deal with…

5 participants

@mdoutreluingne@HeahDude@javiereguiluz@wouterj@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp