yii2-user icon indicating copy to clipboard operation
yii2-user copied to clipboard

How set default status Active?

Open des1roer opened this issue 7 years ago • 2 comments

How set another default status

des1roer avatar Jun 17 '17 06:06 des1roer

override the setRegisterAttributes function

https://github.com/amnah/yii2-user/blob/master/models/User.php#L323-L349

amnah avatar Jun 18 '17 14:06 amnah

or by setting $status=1 in form.php: https://github.com/amnah/yii2-user/blob/master/views/admin/_form.php#L34-L35

<?php if($user->isNewRecord) $user->status = 1; ?>

Before: <?= $form->field($user, 'status')->dropDownList($user::statusDropdown()); ?>

imtiazmahbub avatar Sep 21 '17 07:09 imtiazmahbub