【发布时间】:2014-02-16 16:54:45
【问题描述】:
我尝试显示 (*localhost/ujian/index.php/user_controller*) 但没有找到,为什么?
代码
class User_controller extends CI_Controller{
function __construct()
{
parent ::__construct();
$this->load->model('user_model');
$this->load->helper(array('form'));
}
function user()
{
$data['judul'] = 'Daftar User';
$this->load->view('user', $data);
}
function simpan_user()
{
$this->user_model->simpan_user();
$data['notifikasi'] = 'Data berhasil disimpan';
$data['judul']='Insert Data Berhasil';
$this->load->view('notifikasi', $data);
redirect('user_controller');
}
function view()
{
$data['daftar_user'] = $this->user_model->get_user_all();
$this->load->view('daftar_user', $data);
}
function delete_user($id)
{
$data['daftar_user'] = $this->user_model->get_user_all();
$this->load->view('daftar_user', $data);
$username = $this->user_model->delete_user($id);
redirect('user_controller');
}
我尝试显示 (*localhost/ujian/index.php/user_controller*) 但没有找到,为什么?
【问题讨论】:
-
添加你的控制器类名代码行..
-
你打电话的网址是什么?
-
类已经在添加中。(类 User_controller 扩展 CI_Controller)
标签: php mysql codeigniter localhost