Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
DaveF67 #1
MX7: Can CFC's use a function in Application.cfm?
Version CF7 and cf6.1 if possible.... I have built a function inside my
Application.cfm file. (a basic error messae with output) I can use said
function anywhere in my applications EXCEPT a CFC. (when a CFC throws an error,
I want to use the error function) Is this the way it is, or am I doing
something wrong?
DaveF67 Guest
-
how to create search function in flash application
:confused;:embarrassment; -
Multiple Application.cfc's?
Is it possible to use multiple application.cfc's in a single application (portal web sites). i know in previous versions all I had to do was... -
application.cfc and onError function
I have a newly built application.cfc that includes an onError function. As some have figured out, the onError function is run whenever there is a... -
Is Application.cfm included in CFC's
See title. -
Instatiating CFC's into application scope
Hi All, This is a bit of a dumb question. I worked out how to instatiate a component into the application scope, and I can cfdump it to see that... -
Joseph Gooch #2
Re: MX7: Can CFC's use a function in Application.cfm?
DaveF67 wrote:
an error,> Version CF7 and cf6.1 if possible.... I have built a function inside my
> Application.cfm file. (a basic error messae with output) I can use said
> function anywhere in my applications EXCEPT a CFC. (when a CFC throwsYour function, unless qualified, would be in the variables scope. CFC's> I want to use the error function) Is this the way it is, or am I doing
> something wrong?
>
have their own variables scope.
The Request scope would be visible to all pages and all CFC's, but if
it's really a global error handler, you'd probably want to put it in the
Application scope once and forget about it.
You can place the function by assignment or by name:
<cffunction name="Application.errorHandler" returntype="void"
access="public" output="true">
...
</cffunction>
or
<cffunction name="errorHandler" returntype="void" access="public"
output="true">
...
</cffunction>
<cfset Request.errorHandler = errorHandler />
Personally, I throw all my tool functions like this into a CFC and
create the CFC once in the Application scope.
Joe
Joseph Gooch Guest



Reply With Quote

