Sean,

Great resource, those coding guidelines.  I have a related question.  

I noticed the guidelines specify removing cf processing into a physically different 
template.  Is it such a bad thing to keep a template and any directly associated 
actions in the same file for the sake of keeping unique, directly related code 
together in the same file?

An example is below.  Before everybody freaks out, I am NOT talking about lumping all 
code into a single template.  Anything re-usable would be broken out into includes and 
modules.  The stuff I'm talking about is only unique code.

<cfsilent>
<cfif isdefined ("url.DoStuff") and (...other conditions...)>
        <cfswitch expression="#url.DoStuff#">
                <cfcase value="1">
                        <!--- 
                        do something 
                        --->
                </cfcase>
                <cfcase value="2">
                        <!--- 
                        do something else 
                        --->
                </cfcase>
                <cfdefaultcase>
                        <!--- 
                        call security.  
                        bogus parameter 
                        --->
                </cfdefaultcase>
        </cfswitch>
</cfif>
<!--- 
...
cf queries/code/processing goes here 
...
--->
</cfsilent>
<cfinclude template="includes/inc_tophalf.cfm">
<!--- 
unique html elements and cfoutput goes here 
--->
<cfoutput>
<a href="#cgi.Script_Name#?DoStuff=1">Do Something</a>
</cfoutput>
<cfinclude template="includes/inc_bottomhalf.cfm">


-------------------------------------------
 Matt Robertson,     [EMAIL PROTECTED]
 MSB Designs, Inc. http://mysecretbase.com
-------------------------------------------

 
             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to