The way see it, using getpagecontext to pull in an HTML file has the
advantage that it doesn't cause CF to "process" the included file,
whereas cfinclude will always treat it as if it were cfml, i.e.
compile a class etc. On the other hand, you can cfinclude an HTML file
from anywhere, but getpagecontext has to reference a file under the
web root.
Personally, i use getpagecontext to "include" dynamically created (and
cached) HTML year-planner type pages. And also to request various
scheduled tasks: rather than having a dozen or so tasks to set up in
cf admin i now hav one which says:
getpagecontext('/schedule/task1.cfm?requesttimeout=120');
sleep(5000);
getpagecontext('/schedule/task2.cfm?requesttimeout=120');
etc.
Bert
ps and i use cfinclude a lot too.
On Fri, 14 Jan 2005 22:50:18 -0000, Ciliotta, Mario
<[EMAIL PROTECTED]> wrote:
> Hi can anyone tell me the value of using getpagecontext vs <CFINCLUDE>.
>
> I have a few sites that make big use of CFINCLUDE to include HTML and I was
> wondering if the getpagecontext is a better choice. Also do you need to put
> CFOUTPUT around it or just use it in cfscript
>
> Here is my example below.
>
> Thanks
> Mario
>
> <CFINCLUDE template="./html/spacer.htm">
>
> <CFSCRIPT>
> getPageContext().include("./html/spacer.htm")
> </CFSCRIPT>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190554
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54