Skip to content

Removed a wrong note about controllers as services #8669

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

Conversation

javiereguiluz
Copy link
Member

@javiereguiluz javiereguiluz commented Nov 15, 2017

This is probably wrong. We're discussing about that in symfony/symfony#24976.

@xabbuh
Copy link
Member

xabbuh commented Nov 15, 2017

I would reword the note a bit. Its initial goal was to say that you cannot drop the Action suffix in the configuration when it is part of your method name (which is different from what we have when using the triple syntax). I think we should write something like that you must give the full method name and that no Action will be suffixed automatically.

@chalasr
Copy link
Member

chalasr commented Nov 15, 2017

Agree with @xabbuh


Unlike the traditional ``Bundle:Controller:method`` notation, when using
this syntax the method name must match the original controller method name,
so you cannot remove the ``Action`` suffix if the method includes it.
Copy link
Member

Choose a reason for hiding this comment

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

I would make this a new sentence

@@ -104,8 +104,9 @@ defined above with the id ``app.hello_controller``::

Copy link
Member

Choose a reason for hiding this comment

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

Unrelated, but I think we should remove the forward example entirely and just keep the routing example (and probably move the note below the routing example).

syntax.
Unlike the traditional ``Bundle:Controller:method`` notation, when using
this syntax the method name must match the original controller method name,
so you cannot remove the ``Action`` suffix if the method includes it.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this wording?

Make sure the method name in your route (e.g. ``indexAction``) matches the method name exactly.
Unlike the traditional ``Bundle:Controller:method`` notation, the `Action` suffix is not automatically
added for you.

Copy link
Member Author

Choose a reason for hiding this comment

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

I like your proposal. Much better. Thanks!

@xabbuh
Copy link
Member

xabbuh commented Nov 16, 2017

Thank you @javiereguiluz.

xabbuh added a commit that referenced this pull request Nov 16, 2017
…reguiluz)

This PR was squashed before being merged into the 2.7 branch (closes #8669).

Discussion
----------

Removed a wrong note about controllers as services

This is probably wrong. We're discussing about that in symfony/symfony#24976.

Commits
-------

669a9f0 Removed a wrong note about controllers as services
@xabbuh xabbuh closed this Nov 16, 2017
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.

6 participants