/examples/api_jsonutil/resources/JsonUtilRepresentation.cfc

http://github.com/atuttle/Taffy · ColdFusion CFScript · 16 lines · 13 code · 3 blank · 0 comment · 0 complexity · 8fb0d5e296f2811b3e1dd4cd9a30dd31 MD5 · raw file

  1. <cfcomponent extends="taffy.core.baseRepresentation">
  2. <cffunction
  3. name="getAsJson"
  4. output="false"
  5. taffy:mime="application/json"
  6. taffy:default="true">
  7. <cfreturn variables.jsonUtil.serialize(variables.data) />
  8. </cffunction>
  9. <cffunction name="setJSONUtil" output="false">
  10. <cfargument name="JSONUtil" required="true" />
  11. <cfset variables.jsonUtil = arguments.JSONUtil />
  12. </cffunction>
  13. </cfcomponent>