Where does the conditional go?
I would say definitely not in the aQuery.cfm file, b/c that makes that file
more difficult to reuse. I might include it in the actDoSomething file if
it was intrinsically a part of the DoSomething action, and if neither the
query nor the dosomething file would be likely to be reused in other
situations. However in most cases i would put the logic in the index. If
the conditional involved an application security setting, i would struggle
to put it in the index in all circumstances.
At 10:05 AM 4/9/01 -0400, you wrote:
><cfcase value="doSomething">
> <cfinclude template="actDoSomething.cfm">
> <cfif includeQuery>
> <cfinclude template="aQuery.cfm">
> </cfif>
></cfcase>
>
>
>Except that I wouldn't not have the cfif statement in the cfswitch/cfcase
>(fuseaction) statement. Looks ugly. I'd actually keep it in the aQuery.cfm
>file
>
>
>----- Original Message -----
>From: "Hal Helms" <[EMAIL PROTECTED]>
>To: "Fusebox" <[EMAIL PROTECTED]>
>Sent: Monday, April 09, 2001 8:18 AM
>Subject: Surveying the community
>
>
> > Folks,
> >
> > Question on how you handle queries: Some people always include query files
> > in other files, like this in actDoSomething.cfm:
> >
> > <cfinclude template="/Queries/aQuery.cfm">
> >
> > Others let the fusebox itself handle this, like this:
> >
> > <cfcase value="doSomething">
> > <cfinclude template="actDoSomething.cfm">
> > <cfinclude template="aQuery.cfm">
> > </cfcase>
> >
> > My question is this: if you use the second method, how do you handle the
> > situation where you would only want to call "aQuery.cfm" IF a variable in
> > "actDoSomething.cfm" was set to true? Do you do it in the fusebox, like
> > this:
> >
> > <cfcase value="doSomething">
> > <cfinclude template="actDoSomething.cfm">
> > <cfif includeQuery>
> > <cfinclude template="aQuery.cfm">
> > </cfif>
> > </cfcase>
> >
> > Or do you do something else? I'm just trying to see how different
>developers
> > handle this situation.
> > Hal Helms
> >
> > Team Allaire
> >
> > [ See www.halhelms.com for info on training classes ]
> >
> >
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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