/** * Creates a new Permission model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate($userId) { $model = new Permission(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['user/view', 'id' => $model->userId]); } else { return $this->render('create', ['model' => $model, 'userId' => $userId, 'modulesmap' => new Metadata()]); } }
/** * Creates a new Permission model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Permission(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'principal_id' => $model->principal_id, 'subordinate_id' => $model->subordinate_id, 'type' => $model->type, 'action' => $model->action]); } else { return $this->render('create', ['model' => $model]); } }