|
CFDJ TOP LINKS YOU MUST CLICK ON !
Feature
The Secret Powers of Includes
You've probably been told for years that CFINCLUDE is like a compile-time directive that 'pulls code' from another file into your template for reuse. That's wrong. I'll prove it to you. Indeed, have you ever tried to include something other than a CF template? You can. Wonder what including a text or XML file might do?
Reader Feedback: Page 1 of 1
#7 |
charlie arehart commented on 9 Mar 2007
Craig, have you tried closing the browser in which you were testing? Often when doing anything other than HTML, the browser may cache a result (such as when you have an error) so that even a refresh still shows the old error. If this doesn't work, let's not have a long back and forth here in the comments. :-) Drop me a note at charlie at carehart.org.
|
#6 |
Craig commented on 8 Mar 2007
Hi Charlie,
I tried this out and it didn't work. It was displaying the PDF code in the browser and the Word docs were all scrambled.
Thanks for any suggestions,
Craig
|
#5 |
One more comment: I only recently determined that my trick for using CFINCLUDE to read in a text file has one caveat: if the file being read in has CFML tags in it (like a README file for a CF product), the CFINCLUDE will indeed try to execute those tags, possibly getting errors or doing something otherwise unexpected. Forewarned is forearmed. It still has its place, as discussed in the article.
|
#4 |
I see that in the first figure above, the second box has a mistake. It should be <cfset name="jane">l.
|
#3 |
Charlie Arehart commented on 3 Dec 2003
Oops, I left something out of the article. In the section, "Processing Application.cfm on Include", discussing how to include a file AND cause its application.cfm to run, I mentioned that BlueDragon, like CFMX, supports getpagecontext().include() and that it does cause the application.cfm to run.
While I suggested also that BlueDragon extended CFINCLUDE to act this way, I never explained it.
BlueDragon has added a PAGE attribute to CFINCLUDE. It, in effect, does the same thing as the getpagecontext().include(), just as our CFFORWARD does the same thing as getpagecontext().forward(). I just forgot to explain the new PAGE attribute in the article, though I did mention it in passing in the final section, "13 Ways to Reuse".
|
#2 |
mike commented on 2 Aug 2003
Excellent article. I am always impressed by the writeups in the CFDJ. Good job.
|
#1 |
Jeff commented on 16 Jul 2003
Excellent article. Hadn't even thought about the other possibilities with CFINCLUDE. Now that you point them out, I'm sure my subconscious will consider them when I am working on a problem that could use them.
Thanks!
|
YOUR FEEDBACK  | By Charlie Arehart Cecilia wrote: This article helped me focus on the field I wanted which was a user requirement. I noticed that it was written in 2000. This proves that good writing never goes out of style.
I would also like the user to go to the next field automatically after completing the field without pressing TAB or ano... |  | By Nahuel Foronda; Laura Arguello David Jacobson wrote: How would one modify this app to only allow employees to edit their own information assuming there is a cookie identifier already setup? |  | Cliff Mosdall wrote: There’s a very nasty SQL injection attacking our sites at the moment:
DECLARE @S CHAR(4000);
SET @S=CAST(0x44…..72 AS CHAR(4000));
EXEC(@S);
You need to add DECLARE and EXEC to the regex.
I use (exec(|ute)[\s|\(]) which traps EXEC( and EXECUTE |  | By Jinsong Yang Yogesh wrote: Hey Yang,
Nice article. But how actually we handle transaction in case of spring and cxf? |  | By Hal Helms Joe wrote: Well, using agile programming is not stopping our company from outsourcing.
So using technique number seven is not foolproof.
Dont know how it will work out, but some people will be laid off. |
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS |
SYS-CON FEATURED WHITEPAPERS BREAKING NEWS FROM THE WIRES
PaperThin, Inc., the leading provider of ColdFusion Web content
management solution... Nov. 13, 2008 09:59 AM |
 | Adobe and ARM are gonna put Flash Player 10 and AIR, the stuff of web video and rich Internet apps, ... | Of all domestic air carriers, I like Continental the most. They showed Mamma Mia and the food was be... | I’ll just give you one example. Last week my colleague and I were running a private Flex workshop ... | A round-up of the many themes and topics of interest to infrastructure architects, developers and IT... | AIR adds to Flex has a pretty straightforward API for working with local files and directories. Ther... | Reading conference speaker's agreements may reveal some interesting gems. Since I don't have a PR ag... | The technology blueprint of President Elect Barack Obama, if implemented as promised, bodes well for... | There is much debate raging over whether cloud computing and grid computing are one and the same. In... | Writing shell scripts to automate the build and deploy process for ColdFusion applications is not ve... | On Monday October 20 in San Jose, California, the top Rich Internet Applications event of the Fall o... | Join Scott Guthrie as he discusses Microsoft’s commitment to web standards development, Rich Inter... | SYS-CON Events announced today that the leading global rich Internet technology provider Adobe Syste... | Kevin Lynch, who will be keynoting on October 21, 2008, helped originally coin the term "Rich Intern... | Rich Internet Applications offer the potential to fundamentally change the user experience and in do... | Virtualization has become a critical part of Enterprise IT strategy. Why and how has it become one o... | SQL Injection attacks are one of the easiest ways to hack into a website. One recent hack, using a s... | Recursion Software released a private beta version of their Voyager mobile platform, with powerful i... | 2008 is going to be an important year for Rich Internet Applications. Most organizations are deliver... | CFDynamics, a ColdFusion web host, has renewed an agreement with SmarterTools that will allow them t... | From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discu... |
|