When using ColdBox, you are not required to call an action inside of an event. What this means is if the framework detects an incoming event, and one doesn't exist, it will look for a method called index. If it exists, it will execute it. You can also change the name of the default action in your configuration file.
For example, lets say we have an event handler called services and we call it like this:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
index.cfm/services
or
index.cfm?event=services
1index.cfm/services
2or
3index.cfm?event=services
ColdBox will now look in the
services handler for the
index method. If it exists, it will treat the request as
services.index. This is how your function should look, inside of
services:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<cffunction name="index" returntype="void" access="public">
<cfargument name="event">
</cffunction>
1<cffunction name="index" returntype="void" access="public">
2 <cfargument name="event">
3
4</cffunction>
This feature is wonderful on many levels. It lets you create shorter urls and also do some implicit declarations.
Comments
There are no comments for this entry.
[Add Comment] [Subscribe to Comments]