/** * Updates an existing Catalog model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { // data update $data_update = $_POST['Catalog']; $catalog_update = $data_update['catalog_name']; $id_update = $data_update['id_catalog']; SearchTable::updateAll(['name_search' => $catalog_update], ['link_search' => $id_update, 'type_search' => '1']); return $this->redirect(['view', 'id' => $model->id_catalog]); } else { return $this->render('update', ['model' => $model]); } }