Skip to content

Commit

Permalink
feature #4009 Remove "Controllers extends ContainerAware" best practi…
Browse files Browse the repository at this point in the history
…ce (tgalopin)

This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes #4009).

Discussion
----------

Remove "Controllers extends ContainerAware" best practice

As discussed in #4008, I remove the best practice consisting of extending ContainerAware instead of base Controller class to improve DX.

Commits
-------

992033f Remove "Controllers extends ContainerAware" best practice
  • Loading branch information
weaverryan committed Jul 25, 2014
2 parents ba9632e + 1e620ae commit f943eee
Showing 1 changed file with 0 additions and 17 deletions.
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

0 comments on commit f943eee

Please sign in to comment.