Welcome Guest, Not a member yet? Register   Sign In
How to pass multiple values from view->controller->model
#2

[eluser]Pascal Kriete[/eluser]
When you submit a form the values are added to the post array (or get - don't use that though).

Then in your receiving controller you can access the fields like this:
Code:
$first_name = $this->input->post('first_name');
$last_name = $this->input->post('last_name');
...

And to pass them to your model, you put them in an array, and pass it along as a parameter:
Code:
$data = array(
    'first_name' => $this->input->post('first_name'),
    'last_name' => // ... you get the idea
);

$this->the_model->the_function($data);


Messages In This Thread
How to pass multiple values from view->controller->model - by El Forum - 08-05-2008, 05:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB