The goal is to allow the definition of all functions of a .cfm or .cfc using scripting rather than CFML tags.
I would like to change this:
<cffunction name="foo" access="remote">
<cfscript>
....
</cfscript&g开发者_JAVA技巧t;
</cffunction>
Into something like this:
<cfscript>
function remote foo() {
....
}
</cfscript>
Or something else, as long as it can be done within opening and closing cfscript tags.
Not possible in CF8, made possible in CF9:
access returnType function functionName(arg1Type arg1Name="defaultValue1" arg1Attribute="attributeValue...,arg2Type arg2Name="defaultValue2" arg2Attribute="attributeValue...,...) functionAttributeName="attributeValue" ... { body contents }
Defining components and functions in CFScript
So your function would look similar to:
<cfscript>
remote function foo() {
...
}
<cfscript>
You could also do:
function foo() access="remote" returntype="JSON" {
精彩评论