/** * 编辑版块 * @param $id */ public function update($id) { try { $model = new BoardModel(); $board = $model->find($id); if (empty($board)) { throw new Exception('版块不存在'); } if (IS_POST) { $model->post($_POST, $id); $this->redirect('index'); } else { $this->assign('board', $board); $this->assign('pageTitle', '编辑版块'); $this->display('post'); } } catch (Exception $e) { $this->error($e->getMessage()); } }