-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added docs for JSON helper #6453
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
dfridrich
commented
Apr 10, 2016
Q | A |
---|---|
Doc fix? | yes |
New docs? | no |
Applies to | 3.1 |
Fixed tickets | #6425 |
|
||
You can simplify sending JSON response with | ||
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::json` | ||
helper:: |
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.
I miss here some information about the argument/arguments expected by this method.
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.
I will update PR in a while.
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.
The greatest feature of this shortcut is the usage of the Symfony serializer if available. We surely have to document that imo
In #6502 I'm proposing a different way to add this doc. @dfridrich your explanation is correct, but I think it comes too early in the chapter. I propose to move it to the section explaining the base controller. |
@javiereguiluz I agree with you. |
What about moving this note after the http://symfony.com/doc/current/book/controller#forwarding-to-another-controller section? It seems a better place to me than the one proposed in #6502 |
…ridrich, javiereguiluz) This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #6502). Discussion ---------- Added the json() shortcut to the controller chapter This is an alternative to #6453. Commits ------- 8aa429d Syntax issue f1441b2 Explained how contents are serialized 6824706 Fixed typo 95d5f2e Fixed minor typo 0316363 Fixes 78aa9cb Simplified everything 7a8ad76 Moved the json() helper explanation 97a2f9c Added the json() shortcut to the controller chapter ba6a922 Update docs for JSON helper 91b2d00 Added docs for JSON helper
I'm closing this one because #6502 was merged. Still, I would thank you for helping thinking about the best location to document this feature. I hope to see you back with other PRs! |