I\'m developing a REST api with Symfony2 + FOSRest bundle.
I would like to know if there is any way for a call to the api in dev mode (app_dev.php
) from the
With the FOSRestBundle, I use a special template to display the data in an html page, therefore with the debug toolbar.
In my controller with annotations (you also use corresponding methods):
@View(template="AppBundle:Api:data.html.twig", templateVar="data")
And in the template, choosing whatever format you fancy:
{{ data | serialize('json') }}
It is obviously a quick&dirty solution, but does the job. It also limits the ability to display actual html pages on those routes.