Terry,

There is a fairly fundamental difference between <cfinclude> and <cf_mytag>/<Cfmodule>


<cfinclude> drags a page into the page that is currently being processed and processes it in-line with the rest of the code. Everything in the current page is available to your included page.


<cf_mytag>/<cfmodule> will load your page into separate memory space with every call and process it as a separate entity. Any variables that you need from the calling page must be pass through as attributes. You can use the caller scope to reference external variables from inside your custom tag, but this is considered very bad practice, other than to return values from your tag.

It really depend what you are actually doing within this external page as to which is the most appropriate way to include it into your calling page.

You will find that in a heavy usage system custom tags will require more memory in your server and may be slower, than using cfinclude, but its all down to purpose. They aren't the same thing.

Hope that explains them a bit better... But I would get a good book to get a better description... Mastering ColdFusion 5/MX....

Regards

Stephen

What's the consensus?

Is it better (or faster) to use

'<cfinclude template="xxxx.cfm">'

or

'<cf_xxxx>'

in the middle of a display page?

I've tried both ways, and don't seem to see any difference (on CF5) except when trying to validate using Studio's built-in validator.

Sure, the second form is easier to type, but does it have any disadvantages, except as noted?

Cheers
Terry




--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]



Reply via email to