How to declare argument's attributes in cfscript function

Posted by Bharat Patel on July 07, 2010
  0 comments

Hello Friends,
All persons are familiar with cfscript function would like to know how to define parameters qualifiers in cfscript function.
It is just FYI on how to define arguments qualifiers i.e. default value of parameter, It's datatype, Required Or Not. I hope you may find it interesting.

Syntax

    
    public function fun_name(required string argument1 = ''){}

Generally, Using <cfargument /> tag we may declare something like this.

    <cfargument name="arg1" default="123" required="true" type="numeric">


CfScript Equivalent:
    public function scriptFunction(required numeric arg1 = 123){
        .....
    }    

You need to take care about sequence of argument. It will take default required = 'false'. Click here to know more...

Comments


Leave a comment

Tell us about yourself
Your Name     (required field)
Your Email Address     (required field)
Website URL      
Comment and preferences
Your Comment  
   
  Subscribe to this comment thread