一个cfargument的类型可以是&QUOT的;列表"? [英] Can a cfargument be of type "list"?

查看:160
本文介绍了一个cfargument的类型可以是&QUOT的;列表"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有一个这样的说法:

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?

目前,我得到一个错误:

At the moment I get an error:

传递给renderSelectSource功能排除参数不是类型的列表。

The EXCLUDE argument passed to the renderSelectSource function is not of type 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的类型可以是&QUOT的;列表&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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