Jérémy Decool 10/9/2014

Injecter la Request dans un service Symfony2

Read Original

Cet article technique pour développeurs Symfony2 répond à la question courante sur l'injection de la Request dans un service. Il déconseille la mauvaise pratique d'injecter tout le conteneur de dépendances et présente la solution correcte utilisant le service "request_stack" introduit depuis Symfony 2.4, avec un renvoi vers la documentation officielle.

Injecter la Request dans un service Symfony2

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

2
Designing Design Systems
TkDodo Dominik Dorfmeister 2 votes
4
Fragments Dec 11
Martin Fowler 1 votes
5
Adding Type Hints to my Blog
Daniel Feldroy 1 votes
6
Refactoring English: Month 12
Michael Lynch 1 votes
8
10
You Gotta Push If You Wanna Pull
Gunnar Morling 1 votes