Event in abstract controller

HI everyone

All my Coldbox controllers extend my AbsController.

But when I use “event” inside an AbsController function I get an error: event not available.

Is there a way to make “event” also available inside AbsController without pass it anytime?

Something like this:

component extends="another.location.than.cbControllerLocation.AbsController" {
  function myFunc( rc, prc event ){
    var user = super.getUser();

In another.location.than.cbControllerLocation.AbsController:

component {
  function getUser(){
    return event.getPrivateValue("user");  //ERROR, event not exists!

Any hint?

Many thanks.

event is a specific argument to a handler method for every request. You can access it through the controller, but it really should be properly accessed in interceptions and handler actions.

var event = application.cbcontroller.getRequestService().getContext()

1 Like

Perfect! Many thanks :blush: