PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms 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">
 2	
 3	<cfscript>
 4		this.event_cache_suffix = "";
 5		this.prehandler_only 	= "";
 6		this.prehandler_except 	= "";
 7		this.posthandler_only 	= "";
 8		this.posthandler_except = "";
 9		/* HTTP Methods Allowed for actions. */
10		/* Ex: this.allowedMethods = {delete='POST,DELETE',index='GET'} */
11		this.allowedMethods = structnew();
12	</cfscript>
13
14<!----------------------------------------- IMPLICIT EVENTS ------------------------------------------>
15
16	<!--- UNCOMMENT HANDLER IMPLICIT EVENTS
17	
18	<!--- preHandler --->
19	<cffunction name="preHandler" returntype="void" output="false" hint="Executes before any event in this handler">
20		<cfargument name="event" required="true">
21		<cfargument name="action" hint="The intercepted action"/>
22		<cfscript>	
23			var rc = event.getCollection();
24		</cfscript>
25	</cffunction>
26	
27	<!--- postHandler --->
28	<cffunction name="postHandler" returntype="void" output="false" hint="Executes after any event in this handler">
29		<cfargument name="event" required="true">
30		<cfargument name="action" hint="The intercepted action"/>
31		<cfscript>	
32			var rc = event.getCollection();
33		</cfscript>
34	</cffunction>
35	
36	<!--- onMissingAction --->
37	<cffunction name="onMissingAction" returntype="void" output="false" hint="Executes if a request action (method) is not found in this handler">
38		<cfargument name="event" 		 required="true">
39		<cfargument name="MissingAction" required="true" hint="The requested action string"/>
40		<cfscript>	
41			var rc = event.getCollection();
42		</cfscript>
43	</cffunction>
44	
45	--->
46
47<!------------------------------------------- PUBLIC EVENTS ------------------------------------------>
48
49	<!--- Default Action --->
50	<cffunction name="index" returntype="void" output="false" hint="My main event">
51		<cfargument name="event" required="true">
52		<cfset var rc = event.getCollection()>
53		
54		<cfset Event.setValue("welcomeMessage","Welcome to ColdBox!")>	
55		
56		<cfset Event.setView("home")>
57	</cffunction>
58	
59	<!--- Do Something Action --->
60	<cffunction name="doSomething" returntype="void" output="false" hint="Do Something">
61		<cfargument name="event" required="true">
62		<cfset var rc = event.getCollection()>
63		
64		<cfset setNextEvent("general.index")>
65	</cffunction>
66
67<!------------------------------------------- PRIVATE EVENTS ------------------------------------------>
68
69	
70</cfcomponent>