I would like to inject a service into my Controller constructor.
This is the section of the documentation:
http://docs.symfony-reloaded.org/master/guides/dependency_injection/overview.html#referencing-injecting-services
The service I have is called "liip_view" this is setup and ready. I can
access it through $this->container->get('liip_view'), but I don't like these
magic get() methods. Hell for my IDE.
How do I go about configuring the Controller as a service? I have created a
service.yml file in Resources/config
parameters:
my_controller.class:
WhiteOctober\MyAdminBundle\Controller\StudyController
services:
my_controller:
class: %my_controller.class&
arguments: [@liip_view]
But that doesn't seem to work. I'm sure it is very simple but I can't fathom
it out.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en