Search code examples
yiirule

how to define rules for arraylist in model yii 1.1?


i have defined a variable as an array in my model and i have defined rule for that array as :

public $nameList;
public function rules()
{
 array('nameList','type'=>'array','allowEmpty'=>false),
}

I have tried this.I am getting problem?


Solution

  • Try this and it will work

    public function rules()
    {
     array('nameList','type','type'=>'array','allowEmpty'=>false)
    }