/** * Creates a new SopSalesHeader model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new SopSalesHeader(); if ($model->load(Yii::$app->request->post())) { $tgl = $model->TGL != '' ? $model->TGL : Yii::$app->formatter->asDate('now', 'php:Y-m-d'); $model->save(); return $this->redirect(['index']); } else { return $this->renderAjax('create', ['model' => $model, 'data_type_sales' => self::ary_typesales(), 'data_parent_kategori' => self::ary_parent()]); } }