PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/api_jsonxml/resources/CustomRepresentationClass.cfc

http://github.com/atuttle/Taffy
ColdFusion CFScript | 14 lines | 10 code | 4 blank | 0 comment | 0 complexity | 496b76dc69911cb3f1618fb29b4aa80f MD5 | raw file
 1<cfcomponent extends="taffy.core.baseRepresentation">
 2
 3	<cfset variables.jsonUtil = application.jsonUtil />
 4	<cfset variables.AnythingToXML = application.AnythingToXML />
 5
 6	<cffunction name="getAsJSON" taffy:mime="application/json" taffy:default="true" output="false">
 7		<cfreturn variables.jsonUtil.serializeJson(variables.data) />
 8	</cffunction>
 9
10	<cffunction name="getAsXML" taffy:mime="application/xml" output="false">
11		<cfreturn variables.AnythingToXML.ToXML(variables.data) />
12	</cffunction>
13
14</cfcomponent>