Question

Can function argument have hint in cfscript (CF9)?

CFML style:

<cffunction name="myFunc" output="false" returntype="void">
  <cfargument name="arg1" type="arg1" default="default" hint="my hint">
  ...
</cffunction>

CF9 cfscript style:

public void function myFunc(string arg1='default') {
  ...
}

Where to specify hint of the argument (arg1) above?

Was it helpful?

Solution

The easiest way is to to use JavaDoc notation.

component{

/**
* @hint This is a hint
* @arg1 This is an argument hint
* @arg2 This is another argument hint 
*/
public void function myFunc(string arg1='default', numeric arg2) {
  return TRUE;
}

}

OTHER TIPS

I've not played with cf9, but you can do something like this in CF8:

<cffunction name="myFunc" output="false" returntype="void">
  <cfargument name="arg1" type="arg1" default="default" hint="my hint">
  <cfscript>
    //do stuff
  </cfscript>
</cffunction>

Not ideal, but maybe an acceptable comprimise.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top