Author: Dmitry Erofeev (dmeroff@gmail.com)
Inheritance: extends yii\base\Model
Exemple #1
0
 /** @inheritdoc */
 public function run()
 {
     $model = Yii::createObject(['class' => Assignment::className(), 'user_id' => $this->userId]);
     if ($model->load(\Yii::$app->request->post())) {
         $model->updateAssignments();
     }
     return $this->render('form', ['model' => $model]);
 }
 /**
  * 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 \dektrium\rbac\widgets\Assignments::widget(['model' => $model]);
     /*$model = Yii::createObject([
           'class'   => Assignment::className(),
           'user_id' => $id,
       ]);
       
       if ($model->load(Yii::$app->request->post()) && $model->updateAssignments()) {
           
       }
       
       return $this->render('assign', [
           'model' => $model,
       ]);*/
 }