this is my code
what correct this code ?
public function rules()
{
if(isset($_POST['ProfileViewModel']['username']))
{
$rulesArray[] = array('username', 'length', 'min' => 3, 'max' => 20, 'message' => 'Incorrect username (length between 3 and 20 characters).');
}
$rulesArray[] = array('nickname', 'length', 'max'=>50);
$rulesArray[] = array('gender', 'length', 'max'=>6);
return $rulesArray;
}