think php 删除

表单页面

  <a href="/examtest/test/edit/id/{$v['id']}">修改</a>
                    <a href="/examtest/test/delete/id/{$v['id']}" onclick=" return confirm('您确定要删除吗?')">删除</a>

、、、、、、、、、、、、、、、控制器页面

 public function delete($id)
    {
        //
        $result = ExamTest::deleteIofo($id);
        if (!$result) {
            $this->error('删除失败', '/examtest/test/index');
        }
        $this->success('删除成功', '/examtest/test/index');

    }

、、、、、、、、、、、、、、、、、、、、、模型页面

//删除
    public static function deleteIofo($id)
    {
        return self::destroy($id);
    }

 

posted @ 2021-08-14 21:21  王越666  阅读(36)  评论(0)    收藏  举报