Skip to content

Commit 89e38ef

Browse files
Removed invalid examples
Templating isn't a service in Symfony 4+ (even after `composer req templating`), so probably we're looking for the twig service. The Router service isn't public and can therefor not be called from the container: ``` Information for Service "router.default" ======================================== ---------------- ----------------------------------------------- Option Value ---------------- ----------------------------------------------- Service ID router.default Class Symfony\Bundle\FrameworkBundle\Routing\Router Tags - Calls setConfigCacheFactory Public no Synthetic no Lazy no Shared yes Abstract no Autowired no Autoconfigured no ---------------- ----------------------------------------------- ```
1 parent 5d4254e commit 89e38ef

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

controller.rst

+1-3
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,7 @@ If you extend the base ``Controller`` class, you can access :ref:`public service
299299
via the :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::get`
300300
method. Here are several common services you might need::
301301

302-
$templating = $this->get('templating');
303-
304-
$router = $this->get('router');
302+
$twig = $this->get('twig');
305303

306304
$mailer = $this->get('mailer');
307305

0 commit comments

Comments
 (0)