Skip to content

[Controller] Avoid hardcoding the status for the redirection in Controllers #16513

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

Closed
jcchavezs opened this issue Nov 10, 2015 · 3 comments
Closed

Comments

@jcchavezs
Copy link

The redirect and redirectToRoute methods from the Controller are using hardcoded default status code:

https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

Can we use the constant values from Symfony\Component\HttpFoundation\Response instead?

@stof
Copy link
Member

stof commented Nov 10, 2015

I don't understand what you mean. The default value of a method is always hardcoded: if you want to change it, the way to do it is to pass a value to the method instead of relying on the default

@jcchavezs
Copy link
Author

@stof I was not finished with the description. Sorry for that.

@mvhirsch
Copy link
Contributor

👍 for using constants from Symfony\Component\HttpFoundation\Response.
Would there be any side-effect with the PSR-7 bridge?

@fabpot fabpot closed this as completed Nov 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants