There have always been ways to extend ColdFusion through custom tags (and its variations like cfmodule) or by adding a library cfc or by including a file before every page.
I now present another way;
And its all done by one setting:
this.customtagpaths = pathToExtensionFolder!
Lets see it in action. First, set up an Application.cfc like so:
Then in the langaugeExtension folder add as many cfc's as you want for my example I included one called Invoke.cfc (yes, I've wanted a script based version of this for a while! ;) ):
In the root folder I created a test.cfm with the following code:
Being in the root folder the first line should always work. Nothing exciting there. But whats cool is line 4 where variable i is set with no path to Invoke(). And it works. Here is a screenshot:
Next I created a sub folder structure to see if this would still work further down the chain.
And here is the code for dirB/test.cfm:
Which works as well! Here is its screenshot:
You can also place extra CFCs in the servers root CustomTags folder and use new on them. I think this is a bad idea. Its better to write applications that can be dropped anywhere and are not dependent on special server set ups.
So a pretty easy way to more natively expand upon the ColdFusion language and while I mention this.customtagpaths above it is also possible thanks to the new operator introduced in 9.