In Coldfusion, how do I init a component that is located above the current path folder?
- by Dan Sorensen
If I have a folder structure that looks like this:
/
/bin/myComponent.cfc
/reports/index.cfm
How do I initiate myComponent.cfc from index.cfm?
myService = createObject("component", "bin.myComponent");
Using the dot syntax, I know how to go to deeper folders, but how to do I go up a folder, and down into the other folder? Using slash syntax it would be something like this:
../bin/myComponent.cfc
But createObject() doesn't work that way. I'd like to keep a relative path so that I can move this folder to another server without breaking the paths.
Ideas? Thanks!