Y'know.. in all the years that I've been coding in CFML, it never once occurred to me to ask the following question, but here it is..
If I have a page as such:
blah blah blah - foo bar
<cfinclude url="footer.cfm" />
Does the application.cfc trigger only once (for the document, itself)? Or does it trigger once for the document, then once for each include (total of three times for above example)?
(Forgive the n00b question - it just never came to mind until now.)
URL attribute aside, the cfincludes pull the content "into" the existing .cfm page, so the appropriate Application.cfc methods would be called only once. This is still considered one request.
Thanks, @nic_tunney. I couldn't shake that feeling that it was being triggered for each include.
You are implying that the cfinclude tag invokes Application.cfc which is not the case. For clarity, no matter how many cfincludes you use, the Application.cfc is not involved. It is the single request that an agent makes of the server that invokes Appliction.cfc.
I am not implying anything; I'm asking.
I didn't think that cfinclude was triggering application.cfc; I thought that the .cfm file loaded via cfinclude might be triggering application.cfc, because I understood that every .cfc and .cfm file triggered application.cfc.
But now I am of the understanding that only the .cfm file requested by the browser triggers the application.cfc.
Sorry.. I tend to treat all replies as to the channel/thread, not individual users. I rarely look at the "in response to", mostly because it almost blends into the background, the letters are so thin.
But, reading nic_tunney's response, I don't think that nic was implying cfinclude was triggering the application.cfc. Just MHO. I understood it as "cfinclude brings content (from other files) into the existing page", which I guess could be construed as an indirect invoke considering that the content is pulled from another CFML source.
But, I digress (and boy is that painful - bah-dum-bum, tsssssss.)