Copy link to clipboard
Copied
Copy link to clipboard
Copied
quote:
Is there a way I can configure CF or use CFInclude so that this doesn't happen?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
quote:
There are times when I *want* to do exactly this. Have an include template call itself. This is a common way to do a type of recursion logic. Of course the template must have conditional logic on when to break the loop so it is not infinite. But I would not want my CFML to prevent me from using this useful functionality.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I realize this is a discussion from 13 years ago, but for the sake of any who may come upon it, note that 3 years after the original quesiton (and answers, in 2009), CF10 came out with a new optional runOnce attribute (for cfinclude or its script equivalent), which may help in SOME cases where folks were looking for the rough equivalent to PHP's include_once directive. They're not the same, and it may not have helped in the OP's case here (and nearly everyone involved in the thread may have long-since moved on from CF, or at least that one problem), but I wanted to offer it in case others go looking for the info, as I was helping someone today who was looking for it.