ColdFusion whitespace
Quick hit today. Somehow I went six years working with ColdFusion without knowing that functions implicitly output anything inside them, including whitespace! For example, say you have the following function in english.cfc:
<CFFUNCTION name="getHint"> <CFRETURN "Available only in Professional Edition."> </CFFUNCTION>
And you call it from a template like so:
<cfobject component="english" name="localise"> <input type="Button" title="#localise.getHint()#">
The actual out will be:
<input type="Button" title=" Available only in Professional Edition.">
See, it's rendering the whitespace from inside the function, ie the linebreak after <CFFUNCTION> and the tab before <CFRETURN>. It only gets worse as the function gets longer. What you need to do is pass the attribute output="false" to the CFFUNCTION definition.
<CFFUNCTION name="getHint" output="false"> <CFRETURN "Available only in Professional Edition."> </CFFUNCTION>
Now, I just need to find out how to make that the default...