在CF9文档中:在CFScript中定义组件和函数,它说:
你如何指定
我尝试过:
/**
*Comment text, treated as a hint.
*Set metadata, including, optionally, attributes, in the last entries
*in the comment block, as follows:
*@metadataName metadataValue
...
*/
access returnType function functionName(arg1Type arg1Name="defaultValue1"
arg1Attribute="attributeValue...,arg2Type
arg2Name="defaultValue2" arg2Attribute="attributeValue...,...)
functionAttributeName="attributeValue" ... {
body contents
}
你如何指定
arg1Attribute
?我尝试了这个:public void function setFirstname(string firstname="" displayName="first name"){}
但它不起作用。
另外,如何将此翻译为脚本风格?
<cffunction name="setPerson">
<cfargument name="person" type="com.Person"/>
</cffunction>
我尝试过:
function setPerson(com.Person person){}
但这也不起作用。它说:“您不能在此上下文中使用带“.”运算符的变量引用。”