100], [['province', 'city', 'country'], 'string', 'max' => 50], ['locale', 'default', 'value' => Yii::$app->language], // ['locale', 'in', 'range' => array_keys(self::getLocaleList())], [['picture', 'avatar', 'rank_pic'], 'safe'] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'money' => Yii::t('common', '余额'), 'integral' => Yii::t('common', '积分'), 'created_at' => Yii::t('common', 'Created At'), 'updated_at' => Yii::t('common', 'Updated At'), 'signature' => Yii::t('common', 'Signature'), 'avatar' => Yii::t('common', 'Avatar'), 'gender' => Yii::t('common', 'Gender'), 'locale' => '语言', 'province' => '省份', 'city' => '市县', 'address' => '地址', 'contact' => '联系人', 'country' => '国家', ]; } public function behaviors() { return [ TimestampBehavior::className(), // [ // 'class' => UploadBehavior::className(), // 'attribute' => 'avatar', // 'entity' => __CLASS__ // ], ]; } public static function getGenderList() { return [Yii::t('common', 'Male'), Yii::t('common', 'Famale')]; } public static function getLocaleList() { return [ 'zh-CN' => '简体中文' ]; } /** * @return string */ public function getFullArea() { return $this->country . ' ' . $this->province . ' ' . $this->city; } public function afterFind() { parent::afterFind(); // TODO: Change the autogenerated stub } }