Created
March 25, 2014 00:35
-
-
Save bennadel/9752620 to your computer and use it in GitHub Desktop.
ColdFusion Application.cfc Tutorial And Application.cfc Reference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent | |
displayname="Application" | |
output="true" | |
hint="Handle the application."> | |
<!--- Set up the application. ---> | |
<cfset THIS.Name = "AppCFC" /> | |
<cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 0, 1, 0 ) /> | |
<cfset THIS.SessionManagement = true /> | |
<cfset THIS.SetClientCookies = false /> | |
<!--- Define the page request properties. ---> | |
<cfsetting | |
requesttimeout="20" | |
showdebugoutput="false" | |
enablecfoutputonly="false" | |
/> | |
<cffunction | |
name="OnApplicationStart" | |
access="public" | |
returntype="boolean" | |
output="false" | |
hint="Fires when the application is first created."> | |
<!--- Return out. ---> | |
<cfreturn true /> | |
</cffunction> | |
<cffunction | |
name="OnSessionStart" | |
access="public" | |
returntype="void" | |
output="false" | |
hint="Fires when the session is first created."> | |
<!--- Return out. ---> | |
<cfreturn /> | |
</cffunction> | |
<cffunction | |
name="OnRequestStart" | |
access="public" | |
returntype="boolean" | |
output="false" | |
hint="Fires at first part of page processing."> | |
<!--- Define arguments. ---> | |
<cfargument | |
name="TargetPage" | |
type="string" | |
required="true" | |
/> | |
<!--- Return out. ---> | |
<cfreturn true /> | |
</cffunction> | |
<cffunction | |
name="OnRequest" | |
access="public" | |
returntype="void" | |
output="true" | |
hint="Fires after pre page processing is complete."> | |
<!--- Define arguments. ---> | |
<cfargument | |
name="TargetPage" | |
type="string" | |
required="true" | |
/> | |
<!--- Include the requested page. ---> | |
<cfinclude template="#ARGUMENTS.TargetPage#" /> | |
<!--- Return out. ---> | |
<cfreturn /> | |
</cffunction> | |
<cffunction | |
name="OnRequestEnd" | |
access="public" | |
returntype="void" | |
output="true" | |
hint="Fires after the page processing is complete."> | |
<!--- Return out. ---> | |
<cfreturn /> | |
</cffunction> | |
<cffunction | |
name="OnSessionEnd" | |
access="public" | |
returntype="void" | |
output="false" | |
hint="Fires when the session is terminated."> | |
<!--- Define arguments. ---> | |
<cfargument | |
name="SessionScope" | |
type="struct" | |
required="true" | |
/> | |
<cfargument | |
name="ApplicationScope" | |
type="struct" | |
required="false" | |
default="#StructNew()#" | |
/> | |
<!--- Return out. ---> | |
<cfreturn /> | |
</cffunction> | |
<cffunction | |
name="OnApplicationEnd" | |
access="public" | |
returntype="void" | |
output="false" | |
hint="Fires when the application is terminated."> | |
<!--- Define arguments. ---> | |
<cfargument | |
name="ApplicationScope" | |
type="struct" | |
required="false" | |
default="#StructNew()#" | |
/> | |
<!--- Return out. ---> | |
<cfreturn /> | |
</cffunction> | |
<cffunction | |
name="OnError" | |
access="public" | |
returntype="void" | |
output="true" | |
hint="Fires when an exception occures that is not caught by a try/catch."> | |
<!--- Define arguments. ---> | |
<cfargument | |
name="Exception" | |
type="any" | |
required="true" | |
/> | |
<cfargument | |
name="EventName" | |
type="string" | |
required="false" | |
default="" | |
/> | |
<!--- Return out. ---> | |
<cfreturn /> | |
</cffunction> | |
</cfcomponent> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfif NOT CompareNoCase( | |
ARGUMENTS.Exception.RootCause.Type, | |
"coldfusion.runtime.AbortException" | |
)> | |
<!--- Do not process this error. Return out. ---> | |
<cfreturn /> | |
</cfif> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent> | |
<cfset THIS.Name = "TinyApp" /> | |
</cfcomponent> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment