问题描述
可以在cfcomponent中使用cfdump吗?
在cfscript中可以使用cfdump?
Can one use cfdump inside a cfcomponent?Can one use cfdump inside a cfscript?
我知道anser是没有的,那么如何发出函数的值insde cfcomponent
cfscript ?
我使用CF8
I know the anser is no then how can one emit the values of the functions insde cfcomponentcfscript?I am using CF8
推荐答案
是的,有一些注意事项。如果使用CFDUMP后跟CFABORT,则无论组件/方法是否关闭输出,都将显示转储。
Yes, with some caveats. If you use a CFDUMP followed by CFABORT, the dump will be displayed whether or not the component/method has output turned off. That does, of course, abort all processing.
不完全是(除非你使用CF9),但有解决方法。
Not exactly (unless you're using CF9), but there are workarounds.
您可以关闭脚本,放入转储标签,然后重新打开它,如下所示:
You can close your script, put in the dump tag, then re-open it, like so:
</cfscript><cfdump var="#myVar#"><cfscript>
CFLib中还有一个模拟CFDUMP标记的UDF。
There is also a UDF at CFLib that mimics the CFDUMP tag.
添加:在CF9或更高版本中,还有。
Added: In CF9 or later, there is also writeDump().
这篇关于CFdump cfcomponent cfscript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!