The methods in your handlers (actions) have always accepted the "event" object, which is the request context for that event and contains things like the request collection and private request collection.
A common handler method used to look like this:
function index(event) {
var rc = event.getCollection();
var prc = event.getCollection(private=true);
// Do Stuff
}
Remember, if you're using ColdBox 3.1 or higher, every action is now passed a reference to the request collection (rc) and private request collection (prc) as arguments so you don't have to get them yourself.
function index(event,rc,prc){
rc.foo = "Isn't this convenient?";
prc.bar = "Yes, yes it is.";
}
Remembering this tip can help clean up your code by omitting those uneccessary boilerplate lines of code to get the rc and prc.
More info here: http://wiki.coldbox.org/wiki/EventHandlers.cfm#Anatomy_of_an_Event_Handler_Action
Blog
Recent Entries
QR Codes Come to BoxLang Images
The bx-image module can now generate and read QR codes. Two new functions, a string member function, and two new bx:image actions. No extra dependencies for you to manage.
CBSecurity 3.9: 12 Security Middleware for ColdBox, Declared Right on the Route
Ortus Solutions today announces CBSecurity 3.9, a major step forward for securing ColdBox applications. This release adds 12 ready-made security middleware that you attach directly to routes and route groups, with no firewall rules required.
ACF2021 extended support ends on November 10. Is Your Application Ready?
Adobe ColdFusion 2021 reaches the end of extended support on November 10, 2026. If your application still runs on this release, the time to decide what comes next is now.
Adobe ended core support for ColdFusion 2021 on November 10, 2025. The current extended support period is best effort and does not include security patches or hotfixes. When it ends on November 10 2026, organizations will no longer have that support option from Adobe for ColdFusion 2021.
Add Your Comment