http://coldfusion.com logo
#cfml-general
Title
# cfml-general
m

Manta

03/04/2022, 3:53 PM
Hi, i have an <cfinclude>-Tag which includes a *.cfc File. Now I get the SQL Querys from the cfquery-Tag which includes in the cfc file under "cfcomponent"-Tag as Plain Text on the Website... What i do wrong here?
z

zackster

03/04/2022, 3:54 PM
you don't normally cfinclude a cfc?
m

Manta

03/04/2022, 4:01 PM
Okay, so i have to use another way instead of
<cfinclude template="./cfc/module_the.cfc">
correct?
w

websolete

03/04/2022, 4:04 PM
d

drewnathanson

03/04/2022, 4:38 PM
Besides learning CF, you should use either <cfobject> or creaetObject(script). Once the object is instantiated you can run your function and get the results returned to you.
s

Scott Bennett

03/04/2022, 6:12 PM
@Manta specifically you should review http://learncfinaweek.com/course/index/section/Code_Reuse/item/Includes and http://learncfinaweek.com/course/index/section/Code_Reuse/item/Components to ensure that you understand the difference between using cfinclude to re-use code, and using CFCs. I would also read the "functions" and "custom tags" pages of the "code reuse" section on learcfinaweek... Typically CFCs are the primary way you re-use code these days, but the others still have their uses in various scenarios. It is important to understand their distinctions though so that you can choose what is right for your application.
2
2
4 Views