PageRenderTime 15ms CodeModel.GetById 7ms app.highlight 0ms RepoModel.GetById 7ms app.codeStats 0ms

/SampleApplication/ColdBox3/handlers/General.cfc

http://github.com/bobsilverberg/ValidateThisColdBoxPlugin
ColdFusion CFScript | 17 lines | 17 code | 0 blank | 0 comment | 0 complexity | f2f8c2698b8aeea31aa461e8ee0052da MD5 | raw file
 1<cfcomponent extends="coldbox.system.EventHandler" output="false">
	
	<cfscript>
		this.event_cache_suffix = "";
		this.prehandler_only 	= "";
		this.prehandler_except 	= "";
		this.posthandler_only 	= "";
		this.posthandler_except = "";
		/* HTTP Methods Allowed for actions. */
		/* Ex: this.allowedMethods = {delete='POST,DELETE',index='GET'} */
		this.allowedMethods = structnew();
	</cfscript>

<!----------------------------------------- IMPLICIT EVENTS ------------------------------------------>
 2
	<!--- UNCOMMENT HANDLER IMPLICIT EVENTS
	
	<!--- preHandler --->
 3	<cffunction name="preHandler" returntype="void" output="false" hint="Executes before any event in this handler">
 4		<cfargument name="event" required="true">
		<cfargument name="action" hint="The intercepted action"/>
 5		<cfscript>	
 6			var rc = event.getCollection();
 7		</cfscript>
 8	</cffunction>
	
	<!--- postHandler --->
 9	<cffunction name="postHandler" returntype="void" output="false" hint="Executes after any event in this handler">
10		<cfargument name="event" required="true">
		<cfargument name="action" hint="The intercepted action"/>
		<cfscript>	
			var rc = event.getCollection();
		</cfscript>
11	</cffunction>
	
	<!--- onMissingAction --->
12	<cffunction name="onMissingAction" returntype="void" output="false" hint="Executes if a request action (method) is not found in this handler">
13		<cfargument name="event" 		 required="true">
		<cfargument name="MissingAction" required="true" hint="The requested action string"/>
14		<cfscript>	
			var rc = event.getCollection();
		</cfscript>
15	</cffunction>
	
	--->

<!------------------------------------------- PUBLIC EVENTS ------------------------------------------>
16
	<!--- Default Action --->
	<cffunction name="index" returntype="void" output="false" hint="My main event">
		<cfargument name="event" required="true">
		<cfset var rc = event.getCollection()>
		
		<cfset Event.setValue("welcomeMessage","Welcome to ColdBox!")>	
		
		<cfset Event.setView("home")>
	</cffunction>
	
	<!--- Do Something Action --->
	<cffunction name="doSomething" returntype="void" output="false" hint="Do Something">
		<cfargument name="event" required="true">
		<cfset var rc = event.getCollection()>
		
		<cfset setNextEvent("general.index")>
	</cffunction>

<!------------------------------------------- PRIVATE EVENTS ------------------------------------------>
17
	
</cfcomponent>