public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(array('username, password, email', 'required'), array('username, password, email, profile', 'length', 'max' => 128), array('password', 'length', 'max' => 128, 'min' => 6, 'message' => '密码不能少于6个字符'), array('profile', 'safe'), array('id, username, password, email, profile', 'safe', 'on' => 'search'));
}