Luis, I was wondering why most places in ColdBox are happy to assume that the front controller used in ColdBox will always be “index.cfm” but the setNextEvent() method in controller.cfc differs in that it pulls it dynamically like so:
var frontController = listlast(cgi.script_name,"/");
It isn’t hurting anything, but I’m curious why it isn’t consistent with methods like buildLink() in RequestContext.cfc which simply do this:
I’ve seen frameworks that let you choose your own front controller as a setting, but frankly I’ve never had a need to do so. I think it would be fine to simply slap index.cfm into setNextEvent so it is consistent.
Mark, if you do an extended find on coldbox/system you’ll find quite a few references to “index.cfm” in the code. Did you manually find and replace all of those?
For the most part, this can probably be handled nicely with something to the affect of a frontControllerTemplate setting. However, you're going to have a bit of a bootstrapping issue in application.cfc where, once again, the setting won't neccessarily be available before the app is initted. Those gandolf.cfm users out there will still end up having to put "gandalf.cfm" somewhere in their application.cfc so the app can start up. It would be a little redundant to also have it settings file. What if application.cfc put the frontController in application scope somehwere and the loaderService set it as a setting for easy access within the app?
Also, for the record, here are the places I found that I think would need to be updated for ColdBox to support a configurable front controller. I searched the "system" folder of RC1 that I downloaded last night.
\Coldbox.cfc Lines 555 and 557 relocate to debugPanel
\FrameworkSuperType Line 248 cfargument hint
\interceptors\ColdboxSideBar.cfc Lines 208 and 210 side bar link for debug panel and profiler
\interceptors\SES.cfc Line 41 htmlBaseURL configuration
\interceptors\SES.cfc Line 560 checkForInvalidURL method
\interceptors\SES.cfc Lines 789 and 806 regular expression
\web\Controller.cfc Line 375 would need to be updated to use new setting
\web\context\RequestContext.cfc Line 362 getSelf method
\web\context\RequestContext.cfc Line 376 buildLink method
\web\services\DebuggerService.cfc Lines 197, 220, 268, 310, and 385 Setting URLBase variable