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