ColdFusion Community

The online ColdFusion / CFML community website

What happens if we place the CFCs in different folders other than root folder and how we can invoke them? Is it possible to use them?

Views: 7

Reply to This

Replies to This Discussion

Sure, we can place CFCs in different folder. And while creating the object, specify the folder name.... see the following code below...

objName = CreateObject("component", "Foldername.CFCName");

ex: objCFCothr = CreateObject("component", "Model.CFCName");

In the given example, I am placing the CFC in a folder named 'Model'
The below example is ok if our Model folder is in the web root. if you want to place your CFC in folder other than in root, you have to map the path of the cfc in coldfusion administrator (in mapping section). Give the logical name and the directory path. And while referring the cfc, use that logical name the you gave. If the logical name is 'TestPathCFC' then

objName = CreateObject("component", "TestPathCFC.CFCName");

ex: objCFCothr = CreateObject("component", "TestPathCFC.CFCName");

RSS


Latest Activity

Ben Arledge updated their profile
Mar 8
Matt Osbun and CVgeek are now friends
Feb 9
Matt Osbun updated their profile
Feb 9
Pragnesh Vaghela updated their profile
Jan 23
Profile IconBibin, Octal Info Solution, Ashley Andersen and 2 more joined ColdFusion Community
Jan 18
Bibin liked Pablo Varando's discussion What are you looking for in Free ColdFusin Hosting?
Nov 28, 2013
Sergii Galashyn updated their profile
Nov 26, 2013
Kay Smoljak updated their profile
Nov 22, 2013

Members

Translate this page

© 2014   Created by Nick Tong.

Badges  |  Report an Issue  |  Terms of Service