Access from another handler

Hi .

My question is follow.

Can I access the functions from one handler while being in another handler?

If you can, I’d move those functions to another object. Then handler1 and handler2 can just talk to the object with functions that can be used across multiple handlers.

  • Gabriel

Why would you want too? That is the job of models and services to increase code reuse.

You can send the handler to another, but I would be more inclined to refactor your code to move the shared code into something that can be shared better, for example create a service that both handlers can use if needed.


Andrew Scott

I agree with Andrew on this, unless you are trying to reuse controller layer events?

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager: