The ## (pound) sign is very important in Coldfusion.
Expand|Select|Wrap|Line Numbers
- <cfoutput>#variablename#</cfoutput>
However using ## inside cfset and cfif tags is not good coding.
The following would be considered bad coding:
Expand|Select|Wrap|Line Numbers
- <cfset var1=#variablename#>
- <cfif #variablename# eq "">
A good coding standard would be to avoid using pound signs around variables inside cfset and cfif tags:
Expand|Select|Wrap|Line Numbers
- <cfset var1=variablename>
- <cfif variablename eq ""></cfif>
cfinclude and custom tags
All of us are familiar with cfinclude and custom tags, both tags are used to include a file. What is the difference between them?
The main difference between cfinclude and custom tag is that the include tag works in a copy-paste manner. The scope of variables used in the calling page is available in the included page. But custom tags are individual ColdFusion pages, variables and other data are not automatically shared between a custom tag and the calling page, so we have to pass it as arguments.