Skip to content

Remove "Controllers extends ContainerAware" best practice #4009

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
wants to merge 1 commit into from
Closed
Changes from all 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
17 changes: 0 additions & 17 deletions cookbook/bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,6 @@ Extensive documentation should also be provided in the
the ``Resources/doc/`` directory; the ``Resources/doc/index.rst`` file is
the only mandatory file and must be the entry point for the documentation.

Controllers
-----------

As a best practice, controllers in a bundle that's meant to be distributed
to others must not extend the
:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller` base class.
They can implement
:class:`Symfony\\Component\\DependencyInjection\\ContainerAwareInterface` or
extend :class:`Symfony\\Component\\DependencyInjection\\ContainerAware`
instead.

.. note::

If you have a look at
:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller` methods,
you will see that they are only nice shortcuts to ease the learning curve.

Routing
-------

Expand Down