symfonysymfony1

Configure view.yml per environment


I would like to configure view.yml per environment.

In production:

default:
    http_metas:
        content-type: text/json

In dev:

default:
    http_metas:
        content-type: text/html

I need this because I want to debug json response with web debug toolbar. So, I basically need to set content type of response per environment. Is it possible to do it yml? If not, what's the right place to hook into?


Solution

  • You cannot do it in view.yml without rewriting the entire view config handler. I suppose there are a couple of alternatives for this specific example:

    If however, you just want to inspect JSON output, why not use Firebug or Web Inspector?