![]() |
how to pass ALL form parameters to model - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: how to pass ALL form parameters to model (/showthread.php?tid=29438) |
how to pass ALL form parameters to model - El Forum - 04-09-2010 [eluser]pck76[/eluser] Hi, I have a registration form that collects several info that should be inserted in the db, including a confirmation code generated by the controller. I'm new to CI but understand this should be done by the model, but I don't know how to pass ALL the data from the post to the model. can I do something like Code: $this->modelname->insertInDb($this->input->post(), $confirmation_code); I would like to avoid to have to pass all params manually (eg $this->input->post('name'), $this->input->post('surname'), ....) any trick? how to pass ALL form parameters to model - El Forum - 04-11-2010 [eluser]DynamiteN[/eluser] maybe try something like Code: $input = trim($this->input->post('title')); jsut put in the modelfunction name, something like Code: function modelfunction($data, $confirmation_code) { //the code } OR something like that, maybe u can clean that up your self ![]() |