codeigniter 参数太少,无法运行错误消息

taor4pac  于 11个月前  发布在  其他
关注(0)|答案(2)|浏览(109)

控制器:

public function deleteRoom($id){
     $this->Room->deleteRoom($id);
     $this->index();
    }

字符串
浏览次数:

<a class="btn btn-danger" value="<?php echo $data['room_id']; ?>" href="<?= site_url('AdminController/deleteRoom'); ?>"><span class="glyphicon glyphicon-trash"></span></a>


它显示如下:消息:
函数AdminController::deleteRoom()的参数太少,在第532行的C:\xampp\htdocs\hrCI\system\core\CodeIgniter. php中传递了0,预期为1

iyfamqjs

iyfamqjs1#

您没有在链接中传递id。请尝试

<a class="btn btn-danger" value="<?php echo $data['room_id']; ?>" href="<?= site_url('AdminController/deleteRoom/'.$data['room_id']); ?>"><span class="glyphicon glyphicon-trash"></span></a>

字符串

vc9ivgsu

vc9ivgsu2#

<a class="btn btn-danger" href="<?= site_url('AdminController/deleteRoom/' . $data['room_id']); ?>">
<span class="glyphicon glyphicon-trash"></span>

字符串
选中此

相关问题