On Wednesday, Feb 26, 2003, at 11:32 US/Pacific, S. Isaac Dealey wrote:
> So beyond the syntax in the cffunction tag, how and why would you
> reference
> that information?
How: getMetadata().
Why: for whatever reason you want.
You can provide all sorts of additional metadata to cfcomponent,
cffunction, cfargument, cfproperty. For example:
<cfargument name="foo" type="array" basetype="numeric">
Then you might have code that can inspect the metadata and see the
BASETYPE metadata. Perhaps you are writing a better CFCExplorer.
Perhaps you are writing a metaprogramming system. Who knows.
I haven't found it as useful on cfargument as on cfcomponent and
cfproperty. For example, you write a base component that does simple
web form management. It uses cfproperty metadata (in derived
components) to determine what fields, labels and data types to display.
Something like this:
myform.cfc:
<cfcomponent extends="formmanager">
<cfproperty name="username" label="Username"
type="string" maxlength="30" required="true">
<cfproperty name="password" label="Password"
type="password" maxlength="10" required="true">
<cfproperty name="zipcode" label="ZIP or Postal Code"
type="string" maxlength="8" required="false">
...
</cfcomponent>
The base CFC might have renderHTML() and validateForm() methods that
use the property metadata to generate / validate the form.
> I also noticed that the hint attribute of the cffunction tag isn't
> mentioned
> in the list of attributes or in the example in the livedocs, but it
> does
> appear in the "usage" section. Is this an example of extra metadata?
> Iirc
> the hint appears in a cfdump of the function right?
'hint' and 'description' are both used by CFCExplorer I think.
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4