Dans CF9 doc: Defining components and functions in CFScript, il est dit:Comment spécifier les attributs d'argument dans CFscript? (CF9)
/**
*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
}
Comment spécifier vous arg1Attribute
? J'ai essayé ceci:
public void function setFirstname(string firstname="" displayName="first name"){}
mais cela ne fonctionne pas.
De même, comment traduisez-vous cela en style script?
<cffunction name="setPerson">
<cfargument name="person" type="com.Person"/>
</cffunction>
J'ai essayé:
function setPerson(com.Person person){}
et il ne fonctionne pas non plus. "Vous ne pouvez pas utiliser une référence de variable avec". "Opérateurs dans ce contexte", dit-il.
S'il s'agit d'un bug, veuillez voter: http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=80394 – Henry