I’m wondering if there is a proper way to check the dependencies.
For example I’ve got a NewsBundle. Now I’ll have to check if there is a CommentBundle. If there is one, it should execute a few more Code.
Any suggestions?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In addition to markymark’s answer, you can check if a specific service exists from your controller (or any other container-aware code) with the following snippet:
If you’re not sure of the exact alias of a given service, or just for kicks and giggles, you can run the console command
php app/console container:debugto see all services registered with the container.