September 2007
Intermediate to advanced
600 pages
20h 21m
English
Another important tag is <cfparam>. You won’t use this tag here, but in preparation for the next chapters, I’ll explain what this tag is and how it is used.
Earlier in this chapter, you used a function named IsDefined(), which is used to check whether a variable exists. You used IsDefined() to simply check for a variable’s existence, but what if you wanted to create a variable with a default value if it did not exist? You could do something similar to this:
<cfif NOT IsDefined("FirstName")>
<cfset FirstName="Ben">
</cfif>Why would you want to do this? Well, as a rule, you should not include data validation code in the middle of your core code. This is bad practice for several reasons, the most important of which are that ...
Read now
Unlock full access