助けてください。Codeigniterに引数がありません
この私のエラー問題エラー:
私は私が右のチュートリアルに従うと思うが、私は私のコントローラがあり、私のコードから何が間違って
知らない
public function edit($id){
$where = array('id' => $id);
$data['barang'] = $this->model_barang->edit($where,'barang')->results();
$this->load->view('edit',$data);
}
public function update(){
$id = $this->input->post('id');
$jenis = $this->input->post('jenis');
$nama = $this->input->post('nama');
$harga = $this->input->post('harga');
$pemasok = $this->input->post('pemasok');
$data = array (
'jenis' => $jenis,
'nama'=> $nama,
'harga' => $harga,
'pemasok' => $pemasok
);
$where = array(
'id' => $id
);
$this->model_barang->update($where,$data,'barang');
redirect('barang/tampil');
}
m Y モデル、私は私のモデルはあなたがコントローラに$のIDを渡す必要がエラーに
public function edit($where,$table) {
return $this->db->get($table,$where);
}
public function update($where,$data,$table){
$this->db->where($where);
$this->db->update($table,$data);
}
のようなものでなければなりません 'パブリック関数の編集のような($のID = NULL){/ **コード** /}'やメソッドの内部で値を扱う – Girish