/** * Creates a new Repair model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate($truck_license = null, $car_id = null) { $model = new Repair(); if ($model->load(Yii::$app->request->post())) { $model->car_id = $car_id; $model->save(); return $this->redirect(['view', 'truck_license' => $truck_license]); } else { return $this->render('create', ['truck_license' => $truck_license, 'model' => $model]); } }