Closed tarjei closed 4 years ago
Well you can obviously define your own view handler service. Any controllers defined as services should then allow you to easily adjust the view handler service to use.
with #552 I have introduced the concept of per path/host config for the format listener. it would be slightly trickier to do the same here. also i wonder what the performance overhead will be if we keep adding more and more request matchers
Hmm, I ended up just defining an extra service. Maybe some way to define extra viewhandlers in the config is what is needed? I.e. something that is generated in the compile step and thus will incur a much smaller performance penalty.
We could in theory support an approach similar to doctrine connections. where one can either define just one "connection" called "default" or multiple named connections.
this will hopefully be addressed with https://github.com/FriendsOfSymfony/FOSRestBundle/pull/955
Different bundles needs different variations of viewhandler configurations. It would be nice to have a simple mechanism for creating them.
My usecase: FOS Comment bundle needs the templating handlers configured with json to be templated, I do not want that in another bundle that I'm implementing now.