Skip to content

Commit 03aaa5c

Browse files
committed
Document possibility to use ContainerAwareTrait
In addition to symfony/symfony#8488
1 parent 8e6f084 commit 03aaa5c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

book/controller.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,11 @@ itself.
378378

379379
Extending the base class is *optional* in Symfony; it contains useful
380380
shortcuts but nothing mandatory. You can also extend
381-
:class:`Symfony\\Component\\DependencyInjection\\ContainerAware`. The service
382-
container object will then be accessible via the ``container`` property.
381+
:class:`Symfony\\Component\\DependencyInjection\\ContainerAware`or use the
382+
:class:`Symfony\\Component\\DependencyInjection\\ContainerAwareTrait` (>= PHP 5.4).
383+
Both provide an implementation to the
384+
:class:`Symfony\\Component\\DependencyInjection\\ContainerAwareInterface`, making the
385+
service container object accessible via the ``container`` property.
383386

384387
.. note::
385388

0 commit comments

Comments
 (0)