Skip to content

Instantly share code, notes, and snippets.

@twelverobots
Created January 7, 2014 15:14
Show Gist options
  • Save twelverobots/8300749 to your computer and use it in GitHub Desktop.
Save twelverobots/8300749 to your computer and use it in GitHub Desktop.
<cfcomponent>
<cffunction name="onCFCRequest" access="public" returntype="any" output="false">
<cfargument name="cfcname" type="string" />
<cfargument name="method" type="string" />
<cfargument name="args" type="struct" />
<cfset var result = "" />
<cfif structKeyExists(URL, "returnFormat") AND NOT listFindNoCase("json,wddx,plain,xml", URL.returnFormat)>
<cfset structDelete(URL, "returnFormat") />
</cfif>
<cfinvoke component="#arguments.cfcname#" method="#arguments.method#" argumentCollection="#arguments.args#" returnvariable="result" />
<cfreturn result />
</cffunction>
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment