I’d like the response for any URL starting with /api to be in JSON format. Is there a way to configure this for my whole application? I’m using Symfony2 version 2.0.
I’d like the response for any URL starting with /api to be in JSON
Share
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.
If you are using annotations for routes and activate controllers in
routing.yml, you could do this:If you want to set it for one controller only, set it on the controller level annotation: