/** * Deletes an existing MenuItem model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ public function actionDeleteItem($id) { $item = MenuItem::findOne($id); $menu_id = $item->menu_id; $item->delete(); return $this->redirect(['items', 'id' => $menu_id]); }