モデルで機能するフォームがあります。
public function addGame($data, $parent_id = '0') {
// passing variables from POST
...
// insert array
$ins = array(
...
);
$q = $this->db->insert('games',$ins);
$last = $this->db->insert_id();
return site_url().'/'.$last.'/'.$slug;
}
コントローラ:
public function addGame() {
$this->load->model('contrib_model');
if ($this->form_validation->run()) {
$this->contrib_model->addGame($this->input->post()); //submits data
} else {
$this->layout->view('contribute/addGame', $data); //loads view
}
}
私のポイントは-この最後の値が欲しいreturn
...返されることです。私は圧縮を使用しているので、それはできませんecho
(とにかく適切ではありません)。
どうすればこれを解決できますか?