/** * Creates a new DashboardPanel model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new DashboardPanel(); //$model->scenario = 'create'; if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->getSession()->setFlash('success', Yii::t('app', 'Dashboard Panel has been created.')); return $this->redirect(['update', 'id' => $model->id]); } elseif (!\Yii::$app->request->isPost) { $model->load(Yii::$app->request->get()); } return $this->render('create', compact('model')); }
/** * @inheritdoc */ public function load($data, $formName = null) { $this->dashboardPanel->load($data); return parent::load($data, $formName); }