Category Selected:

tutorials

Blog

Tip of the Week: Superclass is Optional For Handlers, Plugins, and Interceptors

Brad Wood |  April 24, 2013

In ColdBox, Event Handlers, Interceptors, and Plugins are represented as CFCs.  You are probably used to their signatures looking like this:

myhandler.cfc
component extends="coldbox.system.EventHandler"{}

myInterceptor.cfc
component extends="coldbox.system.Interceptor"{}

myPlugin.cfc
...

Read More

Tip of the Week: Using the AntiSamy Plugin to Clean User Input

Brad Wood |  March 28, 2013

If your site ever displays text on the page that end users have control over, you should be concerned about XSS attacks.  This could come in the form of user comments at the bottom of an article, user-generated content, or user profile information.  In many instances, the user should never be entering any HTML and you might simply fully escape that text with HTMLEditFormat() or EncodeForHTML() as you output it.

Other times you may be dealing with a forum or message board t...

Read More

Tip of the Week: Being More Productive with the Query Helper Plugin

Brad Wood |  March 15, 2013

The Query Helper plugin is a hidden gem in ColdBox.  This plugin has a handful of super useful functions you can perform against query objects-- some of which you may have gone out of your way to write on your own in the past, or just simply lived without.  Here a brief list of my favorite functions from the Query Helper plugin that allow you to do sweet one-line manipulations of one or more query objects:

filterQuery
Pare down a result set to only ...

Read More

Tip of the Week: Configuring Additional CacheBox Caches

Brad Wood |  February 28, 2013

 

Every ColdBox install comes with an instance of the CacheBox cache aggregator ready to go.  There are two caches that have to be defined: default, and template.  The former is the default provider used if you don't specify another one.  The latter provider is used internally for cached events and views.  What's cool about CacheBox as a cache aggregator is that you can configure as many named providers as you like to report and tune separate areas of your...
Read More

Tip of the Week: CacheBox Tuning with the Debug Panel

Brad Wood |  February 16, 2013

 

If you use CacheBox (and if you use ColdBox to any extent, you do) it is important to inspect your cache performance from time to time.  A poorly tuned cache can bring about unexpected performance issues when your application gets under load (such as the dog-pile effect).
 
Since CacheBox is a cache aggregator that means it has the ability to wrap up multiple caches from different sources under one API.  By default, ColdBox c...
Read More

Tip of the Week: WireBox Debug Output

Brad Wood |  February 06, 2013

 

If you've used WireBox for autowiring the CFCs in your application, you may have reached a point where you were having trouble figuring out what was going on behind the scenes.  This can be especially true if you've added auutowire metdata to a CFC, but the dependencies still aren't getting injected.
 
WireBox actually has pretty robust debug-level logging built in via LogBox that will tell you everything it is doing, but the ques...
Read More

Tip of the Week: Complex ColdBox Settings

Brad Wood |  January 30, 2013

 

One of the handy things about the ColdBox settings CFC is you can store ad-hoc settings for your application which can be retrieved or injected anywhere in your application.  
 
Remember, since your settings config is just a struct in a CFC, you aren't limited to settings which are strings.  You can store pretty much any kind of setting that will fit into a ColdFusion variable.
 

Tip of the Week: Decorating Your Controller

Brad Wood |  January 11, 2013

 

If you've ever wanted to modify any behavior of the core ColdBox controller, you can now do so as of version 3.5.3 with the Controller Decorator feature.  This is accomplished much like the Request Context Decorator.
 
First, add a configuration setting called "ControllerDecorator" in the coldbox struct of your config file.  
 
/config/ColdBox.cfc

Tip of the Week: Using Interceptors

Brad Wood |  December 20, 2012

 

One of the most powerful parts of the ColdBox framework are interceptors.  Interception points are events that happen over the life cycle of your application or a user request which are broadcast by the framework.  Examples would be preProcess (when a request first comes in), onException (when an error happens), or preViewRender (before a view is rendered).  If you any code you want to execute at those points, or if you want to override/modify the default...
Read More