CF_Param
CF_Param is a replacement tag for ColdFusions <cfparam> tag. When using <cfparam> you can specify
a type attribute. The problem with <cfparam> is that if the variable is not of the specified type an error
is thrown. CF_Param was built to catch invalid types and automatically assign the default value to the variable
instead of throwing an error.
When might this be nice to have? For example, let's say we have a page that takes a PageID variable
via the URL. If this type is supposed to be numeric and the URL looks like ?PageID=10 then there is no
problem. But what happens if someone changes the URL to be ?PageID=test? Unless you try/catch the error
yourself, the default value is not used an an error is thrown. If you had used CF_Param instread of receiving an
error, the default value would have been assigned.
See a demo of how CF_Param actually works.
Related Links
Usage and Documentation
Online Demo
Download