I don't think that you would actually bring in another application.cfm file, but you would more likely bring in a file that was included in that other application.cfm file.


Some people would use this method to provide a separate application.cfm file for a "public" area of a web site.  They would then create another application.cfm in a sub-directory of that web site for administration purposes.  That second application.cfm file would control access to the administration sub-directory.  If you had some common code that would be useful in both application.cfm files, you could save that code to a separate file, then include it in both application.cfm files.


It would be possible that your application.cfm file contains only the CFINCLUDE that pulls in the other template, but that is usually not the case.  You would generally have a distinct CFAPPLICATION tag in each application.cfm with different names, timeout settings, etc.


Placement depends on your application/code design.  Yes, you can overwrite variables if you are not careful.  When I build a site, I generally only use a single application.cfm and if I need to control access at a lower level, I just build that into my code.  (You can get quite confused if you forget that you have application.cfm files in sub-directories.  It prevents the top-level application.cfm's actions from carrying down to the sub-levels.)


M!ke  

  _____  

From: Bob Flynn [mailto:[EMAIL PROTECTED]
Sent: Fri 10/1/2004 3:02 PM
To: CF-Talk
Subject: cfinclude application.cfm

I'm in a CFMX certification study group and we just ran across a reference to of using CFINCLUDE in your application.cfm file to bring in a different application.cfm file. The example given was that you might do it use one application.cfm as kind of a common library of variables that would be pulled into the local application.cfm where some section-specific variables are set.  It sounds pretty nifty in theory. I am wondering if any out there has put this into practice and what, if any, issues you have encountered. Can you overwrite a variable with the local applciation.cfm file? Does placement of the include matter? Any experiences and recommendations would be greatly appreicated.

Bob
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to