开发者

ColdFusion dynamic placeholders

开发者 https://www.devze.com 2023-02-08 10:47 出处:网络
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.

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

精彩评论

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

关注公众号