i like it.
conjours images of the possibility of a catch all <cf_update_dB
table="#attributes.somestructure#">, plus all sorts of (more realistic and
practical) wddx things and stuff

Bert

> -----Original Message-----
> From: craig girard [mailto:[EMAIL PROTECTED]]
> Sent: 14 February 2001 17:50
> To: Fusebox
> Subject: modification to formurl2attributes?
> 
> 
> I was building an app a few months ago and I wanted to pass 
> around a series
> of related variables.  What I had was a form for editing 
> products.  I wanted
> to pass around the variables to multiple places, but didnt 
> want to hardcode
> every variable as attributes when using cfmodule.  So what I 
> decided to do
> was name my form elements like so.
> 
> product.id
> product.name
> product.description
> 
> Then I modified formurl2attributes to search for a period in the form
> variables.  If found it would then create a structure for 
> that variable and
> give it the appropriate keys, ie. id/name/description.  Then 
> when passing
> the variables around I only had to pass the structure.
> 
> The code was something like this...
> 
> <cfif isdefined("form.fieldnames")>
>      <cfloop list="#form.fieldnames#" index="field">
>             <cfif Find(".", field)>
>                 <cfset vTempVar = Mid(field,1,Find(".",field) - 1))>
>                 <cfif NOT IsDefined("#Evaluate(vTempVar)#")>
>                     <cfset "#vTempVar#" = StructNew()>
>                 </cfif>
>                 <cfset "#field#" = Evaluate(field)>
> 
>             <!--- normal formurl2attributes code here --->
> 
>     </cfloop>
> </cfif>
> 
> I just thru this down quick, didnt test it so it might not be 
> accurate, I
> also feel a little under the weather today.  But you get the 
> point.  This
> concept came to mind again recently when studying PHP, the 
> PHP server does
> this for you automatically.  I can see where it would be 
> powerful.  Anyone
> have any ideas/comments/suggestions?
> 
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to