如何在cfscript标记中做一个cfdump? [英] How to do a cfdump inside a cfscript tag?

查看:191
本文介绍了如何在cfscript标记中做一个cfdump?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了调试我想转储某些变量到我的网页。



我试过下面但是不工作:

 < cfscript> 
...
< cfif cgi.REMOTE_ADDR eqIP>
< cfdump var =#var1#>< br />
< / cfif>
...
< / cfscript>任何有关可以做什么的线索?

h2_lin>解决方案

你不能像CF 9之前的版本那样直接做。你可以使用 dump() UDF在CFLib中找到。有一个UDF的整个库,模仿CF标签没有直接的CFSCRIPT等效。



ColdFusion 9(和up)提供 writeDump ()函数。


In order to debug I would like to dump certain variables on to my web page. How can I do that from inside a cfscript tag?

I tried the following but it isn't working:

<cfscript>
  ...
  <cfif cgi.REMOTE_ADDR eq "IP">
    <cfdump var="#var1#"><br/>
  </cfif>
  ...
</cfscript>

Any clues on what can be done?

解决方案

You can't do it directly like that in versions before CF 9. You can, however, use the dump() UDF found at CFLib. There's a whole library of UDFs there that mimic CF tags that don't have direct CFSCRIPT equivalents.

ColdFusion 9 (and up) offers the writeDump() function.

这篇关于如何在cfscript标记中做一个cfdump?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆