开发者

ColdFusion dynamic placeholders

I'm writing a page generator to generate ColdFusion templates. I use placeholders (or whatever they're called) where the code shouldn't run immediately.

The following works OK and dumps a valid query object:

<%cfdump var = "#qPages#"%>

But the following attempt to loop through the above query throws the err开发者_StackOverflow社区or: "Complex object types cannot be converted to simple values."

<%cfloop query = "#qPages#"%>

This also throws the same error:

<%cfloop query = "<%=qPages=%>"%>

What am I doing wrong?

(I'm running CF8.)


Because <cfloop> expects a query name, not a query object. Try this:

<%cfloop query = "qPages"%>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜