Custom Tags can be created in ColdFusion to do complex functions. Here are some of things to keep in mind when creating them.
- the documentation from
AlliareMacromediaAdobe completely sucks - the tag parameters are on a structure called "Attributes". To use it, you'd do something like this:
<cfparam name="attributes.parm1" default="parm1">
- Returning complex objects is also a chore. The use of quoted and hashed material is tricky. The structure used to return data to the caller is called "Caller" -- go figure -- but you need to be careful about how it is used. The module
cf_getarecord.cfmis an example. The name of the query is used as the Caller structure field name, so it looks like this:
<cfset "Caller.#Item#" = Evaluate("#Item#Q")>
To explain (if possible!), the Caller.#Item# has to be in quotes to evaluate it as a complete variable name. The same is true of the argument to Evaluate() -- which actually returns the value of "#Item#Q" -- the query.
| Tags: | Categories: |
Recent Changes |
Printable View |
Page History |
Edit Page
Page last modified on October 03, 2011, at 10:33 PM by tamara