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
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions controller/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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).

.. note::

You cannot drop the ``Action`` part of the method name when using this
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.

I would make this a new sentence

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!


You can also route to the service by using the same notation when defining
the route ``_controller`` value:
Expand Down