Last active
January 2, 2016 12:09
-
-
Save twelverobots/8301069 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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="RemoteProxy" method="callMethod" argumentCollection="#arguments#" returnvariable="result" /> | |
<cfreturn result /> | |
</cffunction> | |
</cfcomponent> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent> | |
<cffunction name="callMethod" access="remote"> | |
<cfargument name="cfcname" type="string" /> | |
<cfargument name="method" type="string" /> | |
<cfargument name="args" type="struct" /> | |
<cfset var result = "" /> | |
<cfinvoke component="#arguments.cfcname#" method="#arguments.method#" argumentCollection="#arguments.args#" returnvariable="result" /> | |
<cfif structKeyExists(URL, "returnFormat") AND URL.returnFormat EQ "plain"> | |
<cfset result = result.toString() /> | |
</cfif> | |
<cfreturn result /> | |
</cffunction> | |
</cfcomponent> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment