tingobol / gii-template-collection

Automatically exported from code.google.com/p/gii-template-collection
0 stars 0 forks source link

array_merge parameter orders are wrong in inherited classes #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Your default usage is:

public function rules()
    {
        return array_merge(
        array(
        array('email,password', 'required', 'on'=>'insert'),
        ),
        parent::rules()
        );
    }

This is wrong, as parent::rules() is the 2nd param for array_merge, and will 
overwrite if you define anything on top.

You should change this to:

public function rules()
    {
        return array_merge(
        parent::rules(),
        array(
        array('email,password', 'required', 'on'=>'insert'),
        )
        );
    }

Also add one for the Labels too!

Original issue reported on code.google.com by pentium10 on 23 Jan 2011 at 5:04