I am converting an older site to Coldbox and I am trying to cleanup the Application.cfc, to have as little as possible.
So I have been moving all the methods into my main.cfc, and have coldbox handle all the onAppInit, onRequestStart etc.
So far it has been working out alright, except for onRequestEnd.
When I move my onRequestEnd to main.cfc, the debug info shows that it ran, however, I get no output on the browser.
However, when I remove “main.onRequestEnd” from Coldbox.cfc, and move the method out to my Application.cfc, it works as it did on the legacy site without any problems.
That was part 1.
Second part of my question has to do with the legacy site conversion.
I am converting a huge legacy site and want to keep all the legacy files in a directory outside of views, so that there is no mixing of code and files between coldbox/mvc style coding and the old legacy coding.
However, I want to be able to leverage the functionality in Coldbox, where I don’t have to specify handlers for my old legacy files.
Is there an external view mapping I can add somewhere in Coldbox.cfc?
And by doing so can Coldbox by convention, know which view to render?
What I mean is for existing files without handlers I can call
index.cfm/aboutus/contact
for a file in
/views
/aboutus
contact.cfm
In addition to that I want a mapped location like
/LegacyAppName (this would be like an external view location)
/products
listing.cfm
I want to be able to call that like index.cfm/products/listing
Is Coldbox able to handle both?
I want the external view so that legacy files can remain as-is, until we get the time/budget to convert them over. However, I still want the coldbox configurations etc to run first, since there are global settings and certain interceptors that need to run, even before the legacy files get hit, so they can continue to access certain methods etc.
Thanks in advance,
cbfan