Reputation: 61
I'm trying to inject the entity_manager to my service but, whatever I try it doesn't work. Thera are some different approaches on the web, so which is the correct?
services:
menu:
class: AppBundle\Service\Menu
arguments: ["@doctrine.orm.entity_manager"]
or
services:
menu:
class: AppBundle\Service\Menu
arguments: [@doctrine.orm.entity_manager]
both don't work and give me a
The file "D:\xamp\htdocs\icp\app/config\services.yml" does not contain valid YAML
What I'm doing wrong?
Upvotes: 0
Views: 54
Reputation: 36934
Watch out for spaces. With YAML they are very important.
services:
menu:
class: AppBundle\Service\Menu
arguments: ["@doctrine.orm.entity_manager"]
Upvotes: 3