2015-04-22 49 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包裝)。