Hey Dan,
Here it is:
<cfcomponent>
<!--- Author: dwilson Date: 3/14/2007 Usage: I return an instance
object --->
<cffunction name="getBean" output="false" access="public"
returntype="any" hint="I return an instance object">
<cfargument name="ObjectName" type="string" required="true"/>
<cftry>
<cfreturn createObject( "component",
structFind(getConfig(),
arguments.ObjectName ) ).init() />
<cfcatch type="any">
<cfthrow
message="BAD_OBJECT_CONFIG_IN_INSTANCEFACTORY"
detail="You provided [ #arguments.ObjectName # ] and I can't create
it. Go check the config." />
</cfcatch>
</cftry>
</cffunction>
<!--- Usage: GetConfig / SetConfig methods for Config value --->
<cffunction name="getConfig" access="public" output="false"
returntype="any">
<cfreturn variables.instance.Config />
</cffunction>
<cffunction name="setConfig" access="public" output="false"
returntype="void">
<cfargument name="Config" type="any" required="true" />
<cfset variables.instance.Config = arguments.Config />
</cffunction>
</cfcomponent>
Thanks,
Cliff
--
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en