Skip to content
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

Update the_controller.rst #4644

Closed
wants to merge 2 commits into from
Closed

Update the_controller.rst #4644

wants to merge 2 commits into from

Conversation

teggen
Copy link
Contributor

@teggen teggen commented Dec 13, 2014

Corrected error in the sample code.

Corrected error in the sample code.
@@ -205,8 +205,8 @@ different controller using the ``forward()`` method::
public function indexAction()
{
return $this->forward('AppBundle:Blog:index', array(
'name' => $name
);
'name' => 'Fabien'
Copy link
Member

Choose a reason for hiding this comment

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

Great fixes! Could you please add a , after this line? Then we're ready.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A comma after the last array element? Why so?

Copy link
Member

Choose a reason for hiding this comment

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

it's the Symfony standard. This way, if a new item is added later on, you don't have to add a comma to the previous line (which will mess up the diff in the PR and it's something that's often forgotten).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, that makes sense.

@wouterj
Copy link
Member

wouterj commented Dec 13, 2014

Hmm, while the code does not contain any errors now (which is very nice, thanks!), it still doesn't make sense if you read it (I know this is not your fault, but I just want to point out that we might have to replace it with another example):

  • At first, the BlogController::indexAction is given a name parameter, that doesn't make sense. We're mixing 2 things here: A blog application and a hello world application.
  • Then it also doesn't make any sense to link / to a /blog/Fabien article, does it?

I'm not sure if there is a better example (I never understood the real usage of forwarding).

@wouterj
Copy link
Member

wouterj commented Dec 13, 2014

Saying that, it makes me wonder if we should include this in the quick tour at all. :) /cc @javiereguiluz @weaverryan

@teggen
Copy link
Contributor Author

teggen commented Dec 13, 2014

I think an example about forwarding isn't essential but makes sense.
For the first two or three snippets, a helloWorld is ok, but after that it whould be nice if the examples where more related, maybe building a simple blog app or something like that.

@weaverryan
Copy link
Member

Hi guys!

Thanks for catching the bug :). For me the answer is easy - remove the forwarding section entirely. I think there are likely other changes we need to make (things we need to remove), but for this issue - let's update it to remove the forwarding entirely and then it'll be a great improvement. I asked on Twitter awhile ago about forwarding, and there are almost not use-cases and almost nobody uses them. It's something we should document (and we do), but not in the quick tour :).

@teggen do you mind updating your PR to remove this entire section? If you're short on time, let us know and we can help.

Cheers!

@wouterj
Copy link
Member

wouterj commented Feb 14, 2015

ping @teggen If you don't have any time soon, let us know and we'll take this over.

@wouterj
Copy link
Member

wouterj commented Feb 21, 2015

I've created a new PR with your commits and with a new commit removing the forwarding section: #5037 Thank you for reporting this issue and trying to fix it!

@wouterj wouterj closed this Feb 21, 2015
weaverryan added a commit that referenced this pull request Mar 14, 2015
This PR was merged into the 2.3 branch.

Discussion
----------

Finish 4644: Update the_controller.rst

Replaces #4644

| Q | A
| --- | ---
| Doc fix? | yes
| New docs? | no
| Applies to | all
| Fixed tickets | -

Commits
-------

dbc25a6 Removed forwarding section from the quick tour
17c9257 Update the_controller.rst
77342fa Update the_controller.rst
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.

3 participants