[cgiapp] Turning off Template output for AJAX

kropotkin enquiries at mms-oxford.com
Thu Jan 29 14:28:12 EST 2009


Hi fRew

I went for a simple solution. Our template is added in the postrun filter. I
set a property of the object to be 'ajax' rather than 'browser' in the class
and in post_run I just bail out if this property is 'ajax', not outputting a
template

Thanks

Justin 


Frew Schmidt wrote:
> 
> On Thu, Jan 29, 2009 at 10:06 AM, kropotkin
> <enquiries at mms-oxford.com>wrote:
> 
>>
>> lol
>>
>> Alright. I take the point that it is consistent design wise - but I am
>> outputting JSON so a template isn't really necessary in this case.
>>
>> But does the C:A JSON plugin require me to be using a template?
>>
>> Thanks
>>
>> Kropotkin
>>
>>
> http://code.google.com/p/ptome/source/browse/trunk/modules/TOME.pm#3170
> 
> You've probably come to a decision by now on what to do with this one, but
> I
> just figured I'd throw in my two cents about how we did it on a project I
> had a while back.
> 
> Basically we've got the above template code which does basically what
> you'd
> expect, and if you set it to the plain directive it doesn't actually add
> any
> output at all to the response.  It does have an includes block, but that's
> because we still used a little bit of TT for our AJAX.  Nowadays since I
> use
> JSON I'd probably just have it have nothing for the header.
> 
> That may or may not help :-)
> 
> -- 
> -fREW
> http://blog.afoolishmanifesto.com
> 
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Turning-off-Template-output-for-AJAX-tp21726620p21734019.html
Sent from the cgiapp at lists.openlib.org mailing list archive at Nabble.com.



More information about the cgiapp mailing list