coldfusion - Calling CFC's on another folder level -
i have page use cfc's on. this:
<cfset cfcdashboard = new dashboard()> <cfset grab_image = cfcdashboard.getpicture()>
how call cfc's if inside of folder? of right work if on same level or inside same folder? how call cfc on different level?
or not understanding purpose of cfc?
the new
keyword syntactic sugar call:
<cfset cfcdashboard = createobject("component", "dashboard")>
the rules how coldfusion resolves cfc names in docs.
if use
cfinvoke
orcfobject
tag, orcreateobject
function, access cfc cfml page, coldfusion searches directories in following order:
- local directory of calling cfml page
- web root
- directories specified on custom tag paths page of coldfusion administrator
you can use dot notation corresponds of defined search paths.
<cfset mydashboard = createobject("component", "my.custom.dashboard")> <cfset mydashboard = new my.custom.dashboard()>
will find (where .
means current template directory , /
means web root):
./my/custom/dashboard.cfc
/my/custom/dashboard.cfc
any/custom/tag/path/my/custom/dashboard.cfc
going "up" not possible.
Comments
Post a Comment