event handler helper

Hi coldbox people,

I have some methods/functions that several event handlers share, and i
wondered what is the best place to put them.

The functions i am talking about get a set of queries that populate
drop down boxes, some views use the same drop down boxes, and so i
want different event handlers to be able to call these methods.

I do not think these methods should be in my model, they seem to
belong in the controller part.

So i was thinking to make some cfc's in my handlers directory that do
this, that are not event handlers. I was thinking about making a
LookupHelper.cfc in the root of my handlers directory.

Is this a good idea, or does coldbox have something special for this?

greets,
klaas

Hi ElKlasso,

You can inject common cfc into handler with <cfproperty (coldspring/
lightwire/coldboxocm)

Also more something related to views helper
http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbWhatsNew2.62#ImplicitViewHelpers

I would suggest to declare common CFCs in lightwire so that we can
also inject into model if needed.

Thanks
Sana

Hi,
Thanks, sounds like a good solution. I still want to put that injected
cfc in the handler directory,
as it is a controller helper, will that give any problems?

greets,
klaas

it wont’. I would just create a folder inside my handlers called helpers.