/** * Creates a new Achievement model. * If creation is successful, the browser will be redirected to the 'view' page. * @param integer $playerId * @return mixed */ public function actionCreate($playerId) { $model = new Achievement(); $model->player_id = $playerId; if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['/player/update', 'id' => $playerId]); } else { return $this->render('create', ['model' => $model]); } }