Skip to content

Improved the Templating formats article #7800

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

Merged
merged 3 commits into from
May 12, 2017
Merged

Improved the Templating formats article #7800

merged 3 commits into from
May 12, 2017

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Apr 15, 2017

This continues (and replaces) #7129 . It also adds a minor tip about FOSRestBundle's format listener, as I think it's a quite usefull tool when talking about request formats.

The controller is a little bit confusing. I think it should be a showAction, since it's name is article_show and it gets an id as parameter.
/**
* @Route("/{slug}")
*/
public function showAction(Request $request, Article $article)
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit worried about the Article $article param here because it requires the extra bundle with the param converters. Do any of you see a problem with that too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, let's do $slug and // ... retrieve the article from the database

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@wouterj wouterj force-pushed the berbadger-patch-3 branch from 3ce6f69 to 5cab748 Compare April 15, 2017 14:39
@wouterj wouterj force-pushed the berbadger-patch-3 branch from 5cab748 to dfe9d11 Compare April 15, 2017 14:42
@wouterj wouterj mentioned this pull request Apr 15, 2017
@xabbuh
Copy link
Member

xabbuh commented May 12, 2017

Thank you @berbadger.

@xabbuh xabbuh merged commit dfe9d11 into 2.7 May 12, 2017
xabbuh added a commit that referenced this pull request May 12, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

Improved the Templating formats article

This continues (and replaces) #7129 . It also adds a minor tip about FOSRestBundle's format listener, as I think it's a quite usefull tool when talking about request formats.

Commits
-------

dfe9d11 Mentioned FOSRestBundle's content negotiation
90924db Used the article example consistently in the example
5862c75 Update formats.rst
@xabbuh xabbuh deleted the berbadger-patch-3 branch May 12, 2017 09:36
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