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

SupportstatusCode default param when loading template directly via route#41414

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
fabpot merged 1 commit intosymfony:5.4fromdayallnash:set_status_code_in_route
Oct 27, 2021

Conversation

@dayallnash
Copy link
Contributor

@dayallnashdayallnash commentedMay 26, 2021
edited
Loading

This is my first PR to Symfony, so please be patient as I get to grips with the 'admin' process of getting everything exactly how you want it!

QA
Branch?5.4
Bug fix?no
New feature?yes
Deprecations?no
Tickets
LicenseMIT
Doc PRsymfony/symfony-docs#15376

TODO

  • submit changes to the documentation and update this PR with a link

Summary

Added support forstatusCode default parameter when loading a template directly from route via theSymfony\Bundle\FrameworkBundle\Controller\TemplateController controller (likethis). This will continue to default to a 200 code, but can be changed by updating your route - for instance something like this:

test_route:  path: /test_route  controller:    Symfony\Bundle\FrameworkBundle\Controller\TemplateController  defaults:    # the path of the template to render    template:  'test.html.twig'    # the status code to include in the response headers    statusCode: 201

This could be useful for when you want to render a template without adding any extra business logic in a controller, but don't want to return a 200 response.

ro0NL, javiereguiluz, and alamirault reacted with thumbs up emoji
dayallnash added a commit to dayallnash/symfony-docs that referenced this pull requestMay 26, 2021
Update docs to provide info on potential new feature found here:symfony/symfony#41414
@dayallnashdayallnashforce-pushed theset_status_code_in_route branch from2cfa7cb tob8e9f85CompareMay 26, 2021 11:34
@javiereguiluz
Copy link
Member

Dale, thanks for proposing this contribution! Don't worry about the actual contribution process because we have a lot of patience with newcomers. However, if you have any questions or comments during this process or if you don't feel treated well for any reasons, please tell us so we can quickly fix that. Thanks!

@dayallnashdayallnash changed the titleSupportstatusCode default param when loading template directly via route[FrameworkBundle] SupportstatusCode default param when loading template directly via routeMay 26, 2021
@dayallnash
Copy link
ContributorAuthor

Thanks@javiereguiluz - I've got the PR in a state where it's passing all of the workflows now at least!

Copy link
Contributor

@YaFouYaFou left a comment

Choose a reason for hiding this comment

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

Promising start!

@carsonbotcarsonbot changed the title[FrameworkBundle] SupportstatusCode default param when loading template directly via routeSupportstatusCode default param when loading template directly via routeMay 27, 2021
@nicolas-grekasnicolas-grekas added this to the5.4 milestoneMay 27, 2021
@dayallnash
Copy link
ContributorAuthor

@carsonbot find me a reviewer please

@carsonbot
Copy link

I'm sorry. I could not find any suitable reviewer.

@dayallnash
Copy link
ContributorAuthor

I'm sorry. I could not find any suitable reviewer.

It's ok, you tried. Good bot.

YaFou, shyim, and jvasseur reacted with laugh emojixabbuh and ging-dev reacted with heart emoji

@GromNaN
Copy link
Member

Nice feature. Useful to return a 410 when a page is removed.

dayallnash reacted with hooray emoji

Copy link
Member

@dunglasdunglas left a comment

Choose a reason for hiding this comment

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

LGTM, +1 when@derrabus' comment will be handled.

dayallnash reacted with thumbs up emoji
@dayallnash
Copy link
ContributorAuthor

Sorry about all the commits - I am still getting my head around rebasing (I normally do merging instead). PR should be in a good state now for final review.

@dayallnash
Copy link
ContributorAuthor

The failed tests on TravisCI (PHP 7.2 build) seem unrelated to my change

@derrabus
Copy link
Member

There are a lot of commits in the PR that don't belong here. Can you sort that out?

@dayallnash
Copy link
ContributorAuthor

There are a lot of commits in the PR that don't belong here. Can you sort that out?

I am trying - I just still don't understand rebasing yet. Every time I do it I am prompted to fix loads of conflicts and end up with loads of extra commits on the PR 😞

@dayallnashdayallnashforce-pushed theset_status_code_in_route branch from864dc4d toc49cf7fCompareJune 9, 2021 11:24
@fabpotfabpotforce-pushed theset_status_code_in_route branch 2 times, most recently from318f0e1 to521fe37CompareOctober 27, 2021 17:44
@fabpot
Copy link
Member

To help finish this PR, I've squashed the commits, and rebased on the current 5.4 branch.

chalasr, xabbuh, and dayallnash reacted with thumbs up emoji

…ate directly from route using the `Symfony\Bundle\FrameworkBundle\Controller\TemplateController` controller.
@fabpotfabpotforce-pushed theset_status_code_in_route branch from521fe37 to5a7b666CompareOctober 27, 2021 17:52
@fabpot
Copy link
Member

Thank you@dayallnash.

dayallnash reacted with hooray emoji

@fabpotfabpot merged commitee6bbb2 intosymfony:5.4Oct 27, 2021
@dayallnashdayallnash deleted the set_status_code_in_route branchOctober 29, 2021 09:13
This was referencedNov 5, 2021
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull requestDec 2, 2021
…(dayallnash)This PR was merged into the 5.4 branch.Discussion----------Update templates.rst for PRsymfony/symfony#41414Update docs to provide info on potential new feature found here:symfony/symfony#41414Commits-------3acf948 Update templates.rst
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrAwaiting requested review from chalasr

@jderussejderusseAwaiting requested review from jderusse

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

@wouterjwouterjAwaiting requested review from wouterj

@xabbuhxabbuhAwaiting requested review from xabbuh

@ycerutoycerutoAwaiting requested review from yceruto

@derrabusderrabusAwaiting requested review from derrabus

@dunglasdunglasAwaiting requested review from dunglas

@OskarStarkOskarStarkAwaiting requested review from OskarStark

+1 more reviewer

@YaFouYaFouYaFou approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

10 participants

@dayallnash@javiereguiluz@carsonbot@GromNaN@derrabus@fabpot@dunglas@nicolas-grekas@OskarStark@YaFou

[8]ページ先頭

©2009-2025 Movatter.jp