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 or cfobject tag, or createobject function, access cfc cfml page, coldfusion searches directories in following order:

  1. local directory of calling cfml page
  2. web root
  3. 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

Popular posts from this blog

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -