/** * Creates a new StockRcvd model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new StockRcvd(); $searchModel = new StockRcvdSearch(); $dataProvider = $searchModel->searchRcvd(Yii::$app->request->queryParams); // * data tipe for form stock rcvd $tipe = ArrayHelper::map(TipeStock::find()->asArray()->all(), 'ID', 'NOTE'); // $brg = ArrayHelper::map(::find()->asArray()->all(), 'ID', 'NOTE'); // $tipe = TipeStock::find()->asArray()->all(); if ($model->load(Yii::$app->request->post())) { $model->save(); return $this->redirect(['view', 'id' => $model->ID]); } else { return $this->renderAjax('_form', ['model' => $model, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'tipe' => $tipe]); } }