/** * Creates a new TaskDefined model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new TaskDefined(); $modelDevice = new Device(); $modelAction = new Action(); if ($model->load(Yii::$app->request->post()) && $model->save()) { //return $this->redirect(['view', 'id' => $model->id]); return $this->redirect(['task/index']); } else { return $this->render('create', ['model' => $model, 'from_device_ids' => ArrayHelper::map($modelDevice->getDeviceMaster(), 'id', 'name'), 'to_device_ids' => ArrayHelper::map($modelDevice->getDeviceAll(), 'id', 'name'), 'action_ids' => ArrayHelper::map($modelAction->getActionAll(), 'id', 'name')]); } }