On Fri, Mar 26, 2010 at 9:31 AM, Jon mailinglists <[email protected]> wrote: > On Fri, Mar 26, 2010 at 1:50 PM, Tomas Doran <[email protected]> wrote: >> Jon mailinglists wrote: >>> >>> Hi all, >>> [snip] >> >> How is generating JSON in template toolkit not 100% insane? >> >> Please use something like Catalyst::View::JSON instead? >> > > To be honest I haven't tried it but seeing you're involved in it I > understand that stance :) > > I don't think Catalyst::View::JSON would help me though since I need > to send "YUI JSON", ie: > MyNamespace.callback({"ResultSet":{ >
That's not "YUI JSON", that's just a JSON callback which Catalyst::View::JSON supports just fine (see the CONFIG section of the Catalyst::View::JSON docs). > Which would force me to do make changes in the result anyway, and a > few loops in a tt2 file isn't that much of a problem. > I use JSON callbacks frequently, with YUI, and find that decorating the resulting hash with pagination and then using DBIx::Class::ResultClass::HashRefInflator everything works remarkably well, without any munging. -J _______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
