File tree 1 file changed +0
-25
lines changed
1 file changed +0
-25
lines changed Original file line number Diff line number Diff line change @@ -290,31 +290,6 @@ in your controllers.
290
290
291
291
For more information about services, see the :doc: `/service_container ` article.
292
292
293
- .. _controller-access-services-directly :
294
-
295
- Accessing the Container Directly
296
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297
-
298
- If you extend the base ``Controller `` class, you can access :ref: `public services <container-public >`
299
- via the :method: `Symfony\\ Bundle\\ FrameworkBundle\\ Controller\\ Controller::get `
300
- method. Here are several common services you might need::
301
-
302
- $twig = $this->get('twig');
303
-
304
- $mailer = $this->get('mailer');
305
-
306
- // you can also fetch parameters
307
- $someParameter = $this->getParameter('some_parameter');
308
-
309
- If you receive an error like:
310
-
311
- .. code-block :: text
312
-
313
- You have requested a non-existent service "my_service_id"
314
-
315
- Check to make sure the service exists (use :ref: `debug:container <container-debug-container >`)
316
- and that it's :ref: `public <container-public >`.
317
-
318
293
.. index ::
319
294
single: Controller; Managing errors
320
295
single: Controller; 404 pages
You can’t perform that action at this time.
0 commit comments