viewVar serialization methods

57 views
Skip to first unread message

Ceeram

unread,
Jun 26, 2012, 9:36:14 AM6/26/12
to cakeph...@googlegroups.com
I worked on making viewVars serialization a bit more flexible:

https://github.com/ceeram/cakephp/commit/f9ba24c3256d5ee8f929e2c7ca62291e51655321

This would allow users to override the serialize method for json/xml which is sometimes required, when needing to reformat incorrect (ISO) encoded before serialization, or change the way xml responses are built

Ceeram

unread,
Jun 27, 2012, 7:05:59 PM6/27/12
to cakeph...@googlegroups.com
After some discussion now refactored into this:

https://github.com/ceeram/cakephp/compare/2.2...2.2-serialize

Not making CakeResponse heavier, can now set 'viewClass' => array('json' => 'MyJson', 'xml' => 'Plugin.CustomXml') in the requesthandler component settings to change the view class

Op dinsdag 26 juni 2012 15:36:14 UTC+2 schreef Ceeram het volgende:

William Golden

unread,
Jun 27, 2012, 7:53:56 PM6/27/12
to cakeph...@googlegroups.com
+1 for this, nice work

William Golden

mark_story

unread,
Jul 3, 2012, 1:16:13 PM7/3/12
to cakeph...@googlegroups.com
I like this implementation way more Ceeram.  Having a map in the response class lets people add new classes or replace the existing ones with custom views.  Great stuff :)

-Mark
Reply all
Reply to author
Forward
0 new messages