|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
CFC Questions
Hi,
I have created a .cfc file with some common functions. Its location is wwwroot\cms\lib\common.functions.cfc I'd like to use this on multiple pages of my site but I'm not 100% sure of how to link to it. To give an example, my login form is located in wwwroot\cms\directory\members\login.cfm my problem is that I've only ever used cfc's that where in the same directory of the page that was using it. Can anyone please help me? |
|
#2
|
||||
|
||||
|
I'm guessing you tried just putting in the directory in the the cfinvoke?
__________________
The liver is evil and must be punished! |
|
#3
|
|||
|
|||
|
Quote:
Not 100% sure of what you mean. I can stick the cfc file in the same directory but that would defeat the purpose of what I'm trying to do. I want a common library of functions. But I want them stored in their own directory for organization. I do this in php all the time but all I have to do in that language is require_once "../../common-functions.php"; in this language I cant include a file and then run a function from it i'm guessing. |
|
#4
|
||||
|
||||
|
I haven't tried it myself, but i was thinking something like:
<cfinvoke component="Library\My_Proc"></cfinvoke> |
|
#5
|
|||
|
|||
|
CFCs use dot paths, so you would do:
<cfinvoke component="cms.lib.common.functions".../> or <cfset functions = CreateObject('component', 'cms.lib.common.functions') /> #functions.someMethodName()#
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#6
|
||||
|
||||
|
There we go! knew there had to be a way.
|
|
#7
|
|||
|
|||
|
Quote:
Thank you very much, that worked great! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > CFC Questions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|