/** * Show form with auth items for user. * * @param int $id */ public function actionAssign($id) { $model = Yii::createObject(['class' => Assignment::className(), 'user_id' => $id]); if ($model->load(\Yii::$app->request->post()) && $model->updateAssignments()) { } return \jarrus90\User\widgets\Assignments::widget(['model' => $model]); }
/* * This file is part of the Dektrium project * * (c) Dektrium project <http://github.com/dektrium> * * For the full copyright and license information, please view the LICENSE.md * file that was distributed with this source code. */ use jarrus90\User\widgets\Assignments; /** * @var yii\web\View $this * @var jarrus90\User\models\User $user */ ?> <?php $this->beginContent('@jarrus90/User/views/admin/update.php', ['user' => $user]); ?> <div class="box box-primary"> <div class="box-body"> <?php echo yii\bootstrap\Alert::widget(['options' => ['class' => 'alert-info'], 'body' => Yii::t('user', 'You can assign multiple roles or permissions to user by using the form below')]); ?> <?php echo Assignments::widget(['userId' => $user->id]); ?> </div> </div> <?php $this->endContent();