Well, at first I was thinking something like this:
myWackyHandler.cfc
component routeAlias=“wacky,wackster” {
}
But after thinking, it may be better along with the other THIS settings we let people set in the CFC
myWackyHandler.cfc
component {
this.prehandler_only = “”;
this.prehandler_except = “”;
this.posthandler_only = “”;
this.posthandler_except = “”;
this.aroundHandler_only = “”;
this.aroundHandler_except = “”;
this.allowedMethods = {};
this.routeAlias=“wacky,wackster”;
}
Maybe the name shouldn’t have the word “route” in it since that’s implies SES urls. The following URLs would all use the CFC above
Non-SES
site.com/index.cfm?event=myWackyHandler.index
site.com/index.cfm?event=wacky.index
site.com/index.cfm?event=wackster.index
SES
site.com/index.cfm/myWackyHandler/index
site.com/index.cfm/wacky/index
site.com/index.cfm/wackster/index
Perhaps handlerAlias. I don’t think it should just be “alias” since it might be confused with the component annotation “alias” that WireBox uses.
Of course, this still assumes that the package wouldn’t change, meaning if myWackyHandler.cfc was in a folder called “foobar”, the URLs would still be this:
site.com/index.cfm/foobar/myWackyHandler/index
site.com/index.cfm/foobar/wacky/index
site.com/index.cfm/foobar/wackster/index
In addition to a simple alias to the handler, would it be useful to have an “entrypoint” setting as well which would be any route that completely matched the package and handler?
Then the following:
foobar/myWackyHandler.cfc
component {
this.entrypoint=“foowack”;
}
Would be accessible from here:
site.com/index.cfm/foowack
Basically the same as entering:
addRoute(pattern="/foowack?",handler=“foobar/myWackyHandler”);
Thoughts?
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com