Pritesh Patel
Pritesh Patel

Reputation: 2019

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

Upvotes: 10

Views: 10402

Answers (2)

Philipp
Philipp

Reputation: 11351

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

savecontent variable="myVariable" { WriteOutput("Hello World"); }

Upvotes: 7

Dawesi
Dawesi

Reputation: 421

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.

Upvotes: 23

Related Questions