[thelist] CF Freebie

Oliver Lineham oliver at lineham.co.nz
Sun Dec 17 04:28:08 CST 2000

<tip type="ColdFusion">
Here is an quick way to make the original (unparsed) CFML source to a 
ColdFusion template accessible. Put this code at the top of the file:

<cfparam name="url.source" default=0>
<cfif url.source>
<cfcontent file=#cgi.path_translated# type="text/plain">

If your file is http://somewhere.com/index.cfm you can view the CFML source 
by going to http://somewhere.com/index.cfm?source=1

Note: if your server doesn't set #cgi.path_translated#, you'll have to put 
in eg.
instead (but cgi.path_translated is nicer since you don't have to change it 
for each file, and it the whole thing could be <cfinclude>'d).

Of course, if you don't want your code to be public, you had better not use 
this tip!

     v i b e   m e d i a    http://www.vibe.co.nz/
  po box 10-492              wellington, new zealand
  phone +64 21 210-7845         oliver at lineham.co.nz

More information about the thelist mailing list