What’s the difference between these two blocks of code, when called right after a cffunction tag:
<cfparam name="bork_bork_bork" default="false">
<cfargument name="bork_bork_bork" required="false" default="false">
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
<cfparam>, when used with the default attribute, will ensure that a variable exists. Because there is no scope specified,bork_bork_borkis being put in to theVariablesscope.<cfargument>is used to pass an arguments to a function. These values are stored in theArgumentsscope. You would access the value usingarguments.bork_bork_bork.Note that
arguments.bork_bork_borkandbork_bork_borkare not the same. The scope ofargumentsis only within the function, the other is being stored in theVariablesscope and will be valid anywhere on the page (though I would not recommend coding it that way.)