Skip to content

Instantly share code, notes, and snippets.

@dajester2013
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dajester2013/183e862915972d51279f to your computer and use it in GitHub Desktop.
Save dajester2013/183e862915972d51279f to your computer and use it in GitHub Desktop.
cfc-based custom tags examples
// Sample output
[{"_DEPTH":1,"_CHILDID":6421},{"_DEPTH":2,"_CHILDID":3838}]
<cf_testtag>
<cf_testchild>
<cf_testchild />
</cf_testchild>
</cf_testtag>
component {
public function onStartTag() {
attributes._childId = randrange(1000,9000);
attributes._depth = listLen(getbasetaglist())-2; // one for this tag, plus one for cfinvoke for cfc tags
cfassociate(baseTag="cf_testtag", datacollection="testchildren");
}
}
component accessors=true {
public function onEndTag(attributes, caller, generatedContent) {
WriteOutput(serializejson(this.testchildren));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment