There is no mandatory View layer in Symfony2 because most of
the time, you don't need one. But as soon as you want to do
more complex things, like supporting different formats, or
because you want to share your code with others and make it
more customizable, Views are definitely the way to go.


Yes, but how useful are 3rd party Bundles that do not support
JSON out of the box? It seems to me like we need to make sure
that _all_ Bundles out of the box support (at least in the way of
not having to modify/extend a controller) JSON output.

I'm not sure I understand. Many bundles do not need to have JSON
support. Anyway, we can make that a best practice, but we cannot
enforce it with code.


Any Bundle that outputs direct HTML needs to be able to just return
JSON. This imho includes 90% of all Bundles that will ever get
written. With the various approaches I have mentioned it is possible
to support this without requiring any additional code in the
controller.

Then, you also need to support XML.

Again the key thing that needs to happen is: - move redirect() out of
the controller - make it possible to swap out the view layer without
changing the controller or adding events before and after the
controller passes data or when data returns to/from the view layer

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to