Created
March 25, 2014 00:56
-
-
Save bennadel/9753168 to your computer and use it in GitHub Desktop.
ColdFusion Functions Declared Inside CFScript Have Output
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 | |
output="false" | |
hint="I define the application event handlers and page request settings."> | |
<cfscript> | |
THIS.Name = "CFScriptTesting"; | |
THIS.ApplicationTimeout = CreateTimeSpan( 0, 0, 5, 0 ); | |
// Execute pre-page logic. | |
function OnRequestStart( Page ){ | |
WriteOutput( "OnRequestStart:" ); | |
// Include the user-selected page. | |
VARIABLES.Include( ARGUMENTS.Page ); | |
} | |
// Executes the target template. | |
function OnRequest( Page ){ | |
WriteOutput( "OnRequest:" ); | |
// Include the user-selected page. | |
VARIABLES.Include( ARGUMENTS.Page ); | |
} | |
</cfscript> | |
<cffunction | |
name="Include" | |
access="private" | |
returntype="void" | |
hint="I include templates inside of CFScript."> | |
<!--- Define arguments. ---> | |
<cfargument | |
name="Template" | |
type="string" | |
required="true" | |
hint="I am the template to be included." | |
/> | |
<!--- Include template. ---> | |
<cfinclude template="#ARGUMENTS.Template#" /> | |
<!--- Return out. ---> | |
<cfreturn /> | |
</cffunction> | |
</cfcomponent> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment