name = $role->name; $this->description = $role->description; $this->rule_name = $role->ruleName; $this->data = $role->data; parent::__construct($config); } public function rules() { return [ [['name'], 'required'], [['name', 'description', 'rule_name'], 'trim'], [['description', 'data'], 'string'], [['rule_name'], 'string', 'max' => 64], [['created_at', 'updated_at'], 'integer'], ]; } public function attributeLabels() { return [ 'name' => Yii::t('user', 'Role Name'), 'description' => Yii::t('user', 'Role Description'), 'rule_name' => Yii::t('user', 'Rule Name'), 'data' => Yii::t('user', 'Role Data'), ]; } }