Welcome Guest, Not a member yet? Register   Sign In
How do you save data from your controllers to your models?
#3

[eluser]jprateragg[/eluser]
1. That's what I was planning on doing. I was just unsure about how to pass the data to the model method.

2. Thanks for the link. After reading it over, it appears the author prepares an array at the controller and passes that to the model.

Code:
$person = array('name' => $this->input->post('name'),
    'gender' => $this->input->post('gender'),
    'dob' => date('Y-m-d', strtotime($this->input->post('dob'))));
    $id = $this->personModel->save($person);

Is this the best way to prepare data and send it to the controller? Thanks!


Messages In This Thread
How do you save data from your controllers to your models? - by El Forum - 11-07-2012, 01:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB