Cornfeed.com - Growing tomorrow's e-business
My Account

Sign-in to access your account.
Information

Version: 0.3
Release Date: 4/22/03
Size: 1kb



Navigate
  • Usage and Documentation
  • Online Demo
  • Download





  • 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


    Copyright © Cornfeed.com 1999-2008