8000 [3.3] Document FQCN named controllers by GuilhemN · Pull Request #7864 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[3.3] Document FQCN named controllers #7864

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 4, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Minor reword
  • Loading branch information
javiereguiluz authored May 3, 2017
commit 5fb20031685967b40a8027ec4dc2108cef83065f
18 changes: 8 additions & 10 deletions controller/service.rst
A941
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,15 @@ Then you can define it as a service as follows:
Referring to the Service
------------------------

If the fully-qualified class name (FQCN) of your controller is also the id of
your service then you can refer to your controller using the usual notations.
For example, to forward to the ``indexAction()`` method of the service
defined above with the id ``AppBundle\Controller\HelloController``::
If the service id is the fully-qualified class name (FQCN) of your controller,
you can keep using the usual notation. For example, to forward to the
``indexAction()`` method of the above ``AppBundle\Controller\HelloController``
service::

$this->forward('AppBundle:Hello:index', array('name' => $name));

To refer to a controller that's defined as a service whose ID is not your
controller fully-qualified class name (FQCN), use the single colon (:)
notation. For example, to forward to the ``indexAction()`` method of a service
defined with the id ``app.hello_controller``::
Otherwise, use the single colon (``:``) notation. For example, to forward to the
``indexAction()`` method of a service with the id ``app.hello_controller``::

$this->forward('app.hello_controller:indexAction', array('name' => $name));

Expand Down Expand Up @@ -127,8 +125,8 @@ the route ``_controller`` value:

.. note::

You cannot drop the ``Action`` part of the method name when using this
syntax.
You cannot drop the ``Action`` part of the method name when using the
single colon notation.

.. tip::

Expand Down
0