开发者

Convert A String To A Variable in Coldfusion

I am using a cfloop to generate the titles of a bunch of variables.

Problem is on output I just get the actual variable name ie #qQuery.varName# instead of its value ie "Item N开发者_运维知识库ame".

Heres a quick taste of my code:

<cfloop query="qQuery">
<cfloop query="qTest">
<cfset varTest = "qQuery." & varName>
<cfoutput>#varTest#</cfoutput>
</cfloop>
</cfloop>

Thanks :)


Try something like this:

<cfset vartest = qQuery[varName]>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜