2015-04-22 53 views
2

我在一个组件中实现了一个<cfinterface>。此接口的目的之一是确保在组件内定义某些属性(cfproperty)。所以,我已经明确地为接口中的获取器/设置器创建了函数原型,并在<cfcomponent>标记中设置了accessors="true"。现在cfproperty getter/setter的“output”属性的默认值是多少?

,我想用output="false"在接口这些功能,但它给了我一个错误:

Argument output value mismatch.

The <FunctionName> function does not specify the same value for the output argument in the <ComponentName> ColdFusion component and the <InterfaceName> ColdFusion interface.

我怎样才能确保默认的getter/setter有output="false"

+0

我不认为输出设置应该在接口中指定,应该吗?接口用于指定API行为,而不是如何处理生成的输出。也就是说,如果自动生成的访问器不适合你,你将需要推出自己的访问器。 –

回答

1

你不能。如果你的界面碰巧有output="false",你将不得不编写你自己的getter和setter。我通常会忽略新界面,或者完全不使用界面。

output属性的默认值是不具有定义的output属性(不包含任何内容)。这不只是true(用cfoutput包装)或false(用cfsilent包装)。