Forgetting the good and the bad about using this method, can anyone see 
anything wrong with this? It works but I've not seen any examples 
knocking about so I'm unsure if there's a better way.

<cffunction name="onMissingMethod">

    <cfargument name="missingMethodName" type="string" required="true">
    <cfargument name="missingMethodArguments" type="struct" required="true">

    <cfset var action = Left(ARGUMENTS.missingMethodName, 3)>
    <cfset var property = Right(ARGUMENTS.missingMethodName, 
Len(ARGUMENTS.missingMethodName) - 3)>

    <cfif action EQ "get">
        <cfreturn VARIABLES[property]>
    <cfelseif action EQ "set">
        <cfset VARIABLES[property] = ARGUMENTS.missingMethodArguments[1]>
    </cfif>

</cffunction>

Ta.

-- 
Adrian Lynch

Property Owl Ltd
84 Mendip Court,
Chatfield Road,
London,
SW11 3UZ

020 7924 6419



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290062
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to