Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CFSAVECONTENT in CFSCRIPT

I am good fan of cfsavecontent due to we can convert long text to variable (Event I can dump in it). But recently more started working with CFSCRIPT and can't figure out how to use it inside cfscript tag.

Is there any way to write cfsavecontent inside cfscript. As per my knowledge there is no such function or class available and sure it is pretty hard to implement as well.

Appreciate any feedback.

Thanks Pritesh

like image 707
Pritesh Patel Avatar asked Sep 07 '11 06:09

Pritesh Patel


2 Answers

Here is the answer from the linked page from Dawesis answer (CF9):

savecontent variable="myVariable" { WriteOutput("Hello World"); }
like image 67
Philipp Avatar answered Sep 23 '22 22:09

Philipp


If you are using CF9 and railo you can use savecontent {} see more info here:

http://www.isummation.com/blog/cfsavecontent-in-cf9-cfscript/

It's not quite the same as you need to use writeoutput to output the items. This can also done by appending output to a variable.

like image 34
Dawesi Avatar answered Sep 22 '22 22:09

Dawesi