-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Support statusCode
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Update docs to provide info on potential new feature found here: symfony/symfony#41414
2cfa7cb
to
b8e9f85
Compare
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! |
statusCode
default param when loading template directly via routestatusCode
default param when loading template directly via route
Thanks @javiereguiluz - I've got the PR in a state where it's passing all of the workflows now at least! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promising start!
src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php
Outdated
Show resolved
Hide resolved
statusCode
default param when loading template directly via routestatusCode
default param when loading template directly via route
@carsonbot find me a reviewer please |
I'm sorry. I could not find any suitable reviewer. |
It's ok, you tried. Good bot. |
Nice feature. Useful to return a 410 when a page is removed. |
There was a problem hiding this 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.
075ddea
to
4dec2b5
Compare
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. |
src/Symfony/Bundle/FrameworkBundle/Tests/Controller/TemplateControllerTest.php
Outdated
Show resolved
Hide resolved
The failed tests on TravisCI (PHP 7.2 build) seem unrelated to my change |
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 😞 |
864dc4d
to
c49cf7f
Compare
318f0e1
to
521fe37
Compare
To help finish this PR, I've squashed the commits, and rebased on the current 5.4 branch. |
…ate directly from route using the `Symfony\Bundle\FrameworkBundle\Controller\TemplateController` controller.
521fe37
to
5a7b666
Compare
Thank you @dayallnash. |
…(dayallnash) This PR was merged into the 5.4 branch. Discussion ---------- Update templates.rst for PR symfony/symfony#41414 Update docs to provide info on potential new feature found here: symfony/symfony#41414 Commits ------- 3acf948 Update templates.rst
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!
TODO
Summary
Added support for
statusCode
default parameter when loading a template directly from route via theSymfony\Bundle\FrameworkBundle\Controller\TemplateController
controller (like this). This will continue to default to a 200 code, but can be changed by updating your route - for instance something like this: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.