cfargument 可以是“列表"类型吗? [英] Can a cfargument be of type "list"?
问题描述
我想要一个这样的论点:
I want to have an argument like this:
<cfargument
name="exclude"
type="list"
required="false"
default="-1"
hint="A list of source IDs that should be excluded"
>
我在 http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_a-b_6.html 我不太信任他们.
I don't see it in the docs at http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_a-b_6.html by I don't really trust them.
有谁知道这是否可行,或者我是否必须转换为数组?
Does anyone know if this is possible or will I have to convert to an array?
目前我收到一个错误:
传递给 renderSelectSource 函数的 EXCLUDE 参数不是列表类型.
The EXCLUDE argument passed to the renderSelectSource function is not of type list.
这不是抱怨list"不是有效类型,而是可能只是一个糟糕的错误信息.
It's not complaining that "list" is not a valid type, but maybe it's just a bad error message.
推荐答案
这种情况下的类型将是字符串".列表只是一个字符串.
The type in this case would be "string". A list is just a string.
您可以转换为数组...但除非它为您购买一些我没有看到的东西,否则我不认为仅将参数声明为字符串有问题.
You could do the conversion to array... but unless it buys you something that I'm not seeing, I don't see the issue with just declaring the argument as a string.
这篇关于cfargument 可以是“列表"类型吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!