Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do you put cfimport

My cfimport works on the page, but I tried moving it to onRequestStart and it didn't work. Then I tried putting it in a cfinclude one folder down, and that didn't work. Does the cfimport have to be on the page itself?

like image 805
Phillip Senn Avatar asked May 23 '26 23:05

Phillip Senn


1 Answers

Yes, the tags can only be used on the page where cfimport is used; from the documentation:

The cfimport tag must be on the page that uses the imported tags. For example, if you use a cfimport tag on a page that you include with the cfinclude call, you cannot use the imported tags on the page that has the cfinclude tag. Similarly, if you have a cfimport tag on your Application.cfm page, the imported tags are available on the Application.cfm page only, not on the other pages in the application. ColdFusion does not throw an error in these situations, but the imported tags do not run.

like image 195
Alistair Knock Avatar answered May 26 '26 17:05

Alistair Knock



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!