Filters

I am a cfwheels developer and I am coming back to coldbox again to give it another evaluation for an upcoming project. Since cfwheels is what I am familiar with I am trying to apply my knowledge to coldbox. The basic mvc is familiar and orm but where it gets fuzzy are things like filters. Keep in mind I have no experience with DI/AOP and the documentation is daunting (I have read it beginning to end multiple times and I still have no clue). Especially with no code along video to help me wrap my mind around it (just adobe connect videos which are mostly scattered with no coding along just copy and paste examples). All that said, there are alot of things about coldbox that get me excited like profilebox and contentbox cms and the enterprise support.

So to get to the meat of my question, how would I implement filters in to coldbox like cfwheels? If you’re not familiar with filters, basically they allow you to run code before or after all or specific actions in a controller. Examples: http://cfwheels.org/docs/1-1/chapter/filters

Any help would be much appreciated.

The simplest solution would be AOP-style convention method in your handlers:
http://blog.coldbox.org/blog/tip-of-the-week-aop-simple-interceptions-in-handlers

A much more powerful, but slightly more complex solution would be interceptors. This allow you to run code before or after all sorts of framework points-- not just events:
http://blog.coldbox.org/blog/tip-of-the-week-amazing-interception-points
http://blog.coldbox.org/blog/tip-of-the-week-using-interceptors

The third option is so powerful you may just blow a hole in the universe using it, but it is amazingly powerful which is AOP method interception via WireBox:
http://www.andyscott.id.au/blog/AOP-with-WireBox-within-ColdBox-or-ColdFusion
http://wiki.coldbox.org/wiki/WireBox-AOP.cfm

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Here is also the link to the Interceptor docs:

http://wiki.coldbox.org/wiki/Interceptors.cfm

Thank you so much for your comments as well. We are working on a new site and new docs as we speak. So we are listening :slight_smile:

Thank you.

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Thanks! Works great, alright, now I’m getting super excited –

And I’ll save the universe hole blasting for later :slight_smile: