symfony - Translation inside a service best practice -


i need translate text inside service symfony2 application. heard it's not best practice pass container. simple examples? thanks

indeed it's bad practice pass container argument of service, instead should inject translator :

my.service:     class: my\appbundle\myservice     arguments: ["@translator"] 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -