我正在尝试根据URL参数从数据库中获取数据。为了更新表格。查询已成功执行,没有任何问题。此获取值已正确显示在控制器中,但我无法在视图页面上打印
My controller:
public function edit_staff(){
$userid = $this->uri->segment(4);
if (empty($userid))
{
show_404();
}
$data['staffs']=$this->Admin->edit_staffs($userid);
print_r($data['staffs']);
echo $data['staffs']['id'];
$this->load->view('admin/dashboard/edit_staff', $data);
}
My model:
function edit_staffs($userid){
$this->db->select('*');
$this->db->from('staffs');
$this->db->where('id',$userid);
$query = $this->db->get();
$result = $query->row_array();
return $result;
}
My view shows:
Unable to load the requested file: admin/dashboard/edit_staff.php
URL for view page:
http://localhost/groport/admin/dashboard/edit_staff/18
我希望显示查看页面并打印人员详细信息
答案 0 :(得分:0)
确保文件application/views/admin/dashboard/edit_staff.php
存在。
检查CI documentation,以获取有关CI视图的更多详细信息