On Jan 30, 2004, at 12:35 AM, Roland Collins wrote:
"The cfinclude tag adds the contents of a ColdFusion page to another
ColdFusion page, as if the code on the included page were part of the page
that uses the cfinclude tag. ...

Yes, that probably adds to the confusion... To be fair, explaining cfinclude that way is at least readily understandable by the vast majority of non-programmers (and remember that part of this whole discussion centers on the success of CF in empowering non-programmers).


It would be somewhat harder to explain exactly how cfinclude really worked (that it treats the included file as a separately executed page but somehow weaves together certain scopes in the include file with certain scopes in the 'calling' file).

Bear in mind also that you can 'include' a file in multiple ways:

        <cfinclude template="foo.cfm">
        <cfmodule template="foo.cfm">
        <cf_foo>

These all behave slightly differently yet foo.cfm is unchanged. Then again, consider this subtly different piece of code:

        <cfinclude template="foo.cfm" />
        <cfmodule template="foo.cfm" />
        <cf_foo />

In this case, foo.cfm is executed twice for cfmodule and the custom tag call - but only once for cfinclude.

How complicated do you want the documentation to be?

And another thing to remember is that <cfinclude> determines the template to include at run-time, not compile-time (which is part of the reason that included files must be syntactically valid in their own right):

<cfinclude template="#somePath#/foo.cfm">

Regards,
Sean

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to