So you want to: Write your components using CF9 script component syntax

atuttle edited this page Jun 26, 2012 · 2 revisions
Clone this wiki locally

There's really not much to this, actually. Only a single place where you're required to deviate from "normal" Taffy syntax.

When creating your Resources in CFML (tag) syntax, you use this syntax to define your URI:

<cfcomponent taffy:uri="/photos/tagged/portrait">

However, there is a bug in ColdFusion that prevents you from using a colon in custom metadata attributes in script components. So, to work around this, Taffy also allows you to use an underscore in its place:

component taffy_uri="/photos/tagged/sunset" {}

The exact same issue and resolution applies if any of your Resource Responder methods (for GET, POST, PUT, DELETE, etc) make use of Taffy's custom metadata. For example, if you want to name your method listPhotos and have it respond to the GET verb:

<cffunction name="listPhotos" taffy:verb="GET"></cffunction>
function listPhotos() taffy_verb="GET" {}