well, maybe I should have looked at fusbox 3 along time ago :O)
that is definately a nice simple solution.
thanks
On Wed, 16 Mar 2005 08:53:14 -0600, Steve Bryant
<[EMAIL PROTECTED]> wrote:
> Taken from the Fusebox 3 core files:
>
> <cfscript>
> if (NOT IsDefined("attributes")) attributes=structNew();
> StructAppend(attributes, url, "no");
> StructAppend(attributes, form, "no");
> </cfscript>
>
> You can also use URL[VariableName] or Form[VariableName]
>
> As in:
>
> Attributes[Field] = Form[Field]
>
> Steve
>
> Steve Bryant.
> Bryant Web Consulting LLC
> http://www.BryantWebConsulting.com
> http://steve.coldfusionjournal.com/
>
> At 08:40 AM 3/16/2005, Bill Rawlinson wrote:
> >as a matter of consistency we move all URL and FORM parameters into
> >the Attributes scope and to do that we use evaluate - I would love to
> >know if there is a faster/better way of doing this - and likewise I am
> >defiately open to hearing why moving these variables into the
> >attributes scope might be a bad idea.
> >
> >We move them there so that we reference everything in the same fashion
> >and the person working on the receiving end doesn't have to worry if
> >the data coming to them is via URL or a FORM - they get a consistent
> >source, Attributes, for their passed data.
> >
> > <cftry>
> >
> > <cfset urlKeys = structKeyList(url)>
> >
> > <cfloop list="#urlKeys#" index="thisKey">
> > <cfif NOT IsDefined("Attributes.#thisKey#")>
> > <CFSET
> > SetVariable("Attributes.#thisKey#", Evaluate("url.#thisKey#"))>
> > </cfif>
> > </cfloop>
> >
> >
> > <cfif IsDefined("form.fieldNames")>
> > <cfloop List="#form.fieldNames#" Index="field">
> > <cfif not IsDefined("attributes.#field#")>
> > <cfset
> > SetVariable("attributes.#field#", Evaluate("form.#field#"))>
> > </cfif>
> > </cfloop>
> > </cfif>
> >
> > <cfcatch type="any"></cfcatch>
> > </cftry>
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to
> [email protected] with the words 'unsubscribe cfcdev' as the subject of the
> email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> (www.cfxhosting.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
>
>
--
[EMAIL PROTECTED]
http://blog.rawlinson.us
I have 47! gmail invites,want one?
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]