Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
mate of the state #1
Re: Accessing CFCs in parent directories
Anybody?
Bueller?
mate of the state Guest
-
Accessing a ComboBox from the parent component
I have a component that contains several other components and a combobox with date values. I want to be able to access the value of the combobox... -
CFCs and MX7
I have a site with a photo album that utilizes CFCs and it worked great until my ISP switched to MX7. When they asked me if I thought I would have... -
Child user control accessing parent properties
We have a user control (Titlebar) that loads other user controls (children) into itself based on a property set in the HTML: <fss:Titlebar... -
Using virtual directories for common directories (scripts, images, styles, etc.)
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of... -
#24735 [NEW]: call_user_func on parent method does not use parent private property
From: tater at potatoe dot com Operating system: OS X 10.2 PHP version: 5CVS-2003-07-21 (dev) PHP Bug Type: Zend Engine 2... -
BSterner #2
Re: Accessing CFCs in parent directories
What does the directory structure of your site look like? That is, is the
'public site root' and 'admin' sections under the CF site root? eg:
/CFRoot/admin/... /CFRoot/public/... Are they running under different
instances of CF, different machines, etc.... Have you looked at exposing the
CFC's as a webservice? Could you provide more information about your setup.
BSterner Guest
-
mate of the state #3
Re: Accessing CFCs in parent directories
Certainly, B. :) I'm very new to CFCs, and it's sometimes hard to know what to
assume in general. My setup is like so: /root/ /root/admin/ I want to be
able to put common CFCs in a folder at the root level. It doesn't really matter
where that folder is, I guess. the main point is how to access a single set of
common CFCs from anywhere within' a site's directory structure. It's one
instance of CF, all one machine, etc. Simple setup, and hopefully a simple
solution. ;)
mate of the state Guest
-
BSterner #4
Re: Accessing CFCs in parent directories
In that case, you should be able to reference the component with respect to
root,rdegardless of the sub-directory you're in. <cfinvoke
component='/components/GenericDB.cfc' ....> where '/components' resides under
your site root. Here's an article on site structure (And MVC design) if you're
interested. I found it useful when I was learning to use CFC's.
[url]http://www.benorama.com/coldfusion/patterns/part8.htm[/url]
BSterner Guest
-
mate of the state #5
Re: Accessing CFCs in parent directories
Oh, okay! Thanks, B. :)
Is there anyway to do the same using the createObject function? That is what I was doing to begin with.
mate of the state Guest
-
BSterner #6
Re: Accessing CFCs in parent directories
Sure...
<cfscript>
//Using dot notation
myStr = createObject("component", "components.myCFC");
//Using slash notation
myStr = createObject("component", "/components/myCFC");
//Function name is 'getStr()'
writeoutput(mystr.getStr());
</cfscript>
BSterner Guest
-
mate of the state #7
Re: Accessing CFCs in parent directories
Weird. I thought I tried that, with the dot notation. :\
mate of the state Guest
-
BSterner #8
Re: Accessing CFCs in parent directories
Just make sure you directory structure matches the pattern. That is...
components.level1.level2.myCFC
Should be in the following location...
/site_root/components/level1/level2/myCFC.cfc
BSterner Guest



Reply With Quote

