Skip to content

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

Closed
wants to merge 2 commits into from
Closed

Conversation

dfridrich
Copy link
Contributor

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::
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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

@javiereguiluz
Copy link
Member

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.

@dfridrich
Copy link
Contributor Author

@javiereguiluz I agree with you.

@wouterj
Copy link
Member

wouterj commented May 5, 2016

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

wouterj added a commit that referenced this pull request May 21, 2016
…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
@wouterj
Copy link
Member

wouterj commented May 21, 2016

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!

@wouterj wouterj closed this May 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants