Learning CF9: Why Don't My Comment-Based Attributes Work?
Posted on October 22, 2009 at 6:08 PM in ColdFusion
If you're like me, you absolutely love CF9's new script-based CFCs. I recently re-worked a very simple class and went from 111 lines of code in my old tag-based version down to 66 lines of code in the new all-script version. Nice! But I was having trouble getting comment-based attributes for the component, properties, and functions to actually work.
According to the CF9 docs, you can use comments to create the various bits of metadata for your CFC. For example:
- /**
- * I am the hint for a simple component
- */
- component {
- }
In the above example, the plain text in the comment is the equivalent of using the hint="" attribute on the <cfcomponent> tag. What the docs do not tell you is that you *must* use that exact opening syntax. That is, an opening slash followed by two (or more) asterisks (*).
I have always used a similar syntax, but with just a single asterisk, like so:
- /*
- * I am the hint for a simple component
- */
- component {
- }
It took me forever to figure out why my comment-based metadata was not working properly. Hopefully by writing this post I not only remember it myself, but also help someone else out in the process. :-)
Latest Articles
- No recent entries.
Categories
- ColdBox (21) [RSS]
- ColdFusion (92) [RSS]
- Fusebox (3) [RSS]
- General (22) [RSS]
- jQuery (15) [RSS]
- Kalendar (1) [RSS]
- Linux (1) [RSS]
- Mura CMS (1) [RSS]
- Railo (1) [RSS]
- Rants (5) [RSS]
- Transfer (8) [RSS]
- Uni-Form Tag Library (36) [RSS]
Quick Links
Blogs I Read
Calendar
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| « Feb | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||
Subscribe
Enter a valid email address.



On 10/22/09 at 6:34 PM, andy matthews said:
http://www.danvega.org/blog/index.cfm/2009/8/24/Co...
On 10/22/09 at 7:30 PM, Matt Quackenbush said: