Search code examples
symfonysymfony-2.3fosrestbundle

FOSRestBundle force one route in format html


It is possible to make sure that only a single route is made available only in html format?

In the configuration I set html and json, but for only one route I would like the json was not used.

Can you do?


Solution

  • I have not tried this as I am on a cell phone but have you looked at trying something like this just for that one route:

    my-awesome-route:
      pattern:  /hello/{fist_name}/{last_name}.{_format}
      defaults: { _controller: AcmeHelloBundle:Default:index, _format:html}
    requirements:
      _format: html