[eluser]Brad K Morse[/eluser]
I am creating a confirmation view, and I need to grab all the data that was posted from a post and pass it into that view.
There must be a simple way of doing this...
something like...
Code:
$data[] = $this->input->post('name_of_form');
$this->load->view('confirmation-view', $data);
Then within the view, I can print it out like:
Code:
<?=$first_name?>
<?=$last_name?>
<?=$email?>
Trying to avoid:
Code:
$data['email'] = $this->input->post('email'); $data['first_name'] = $this->input->post('first_name'); ...
or if there is a better way of creating confirmation before db insertion, I am all ears.
Thank you.
UPDATE:
Controller
Code:
$data['steps'] = $this->input->post('step_id[]');
$data['message'] = $this->input->post('message');
$data['department_id'] = $this->input->post('department_id');
$this->load->view('confirmation-view',$data);
Problem now is storing the step_id[] appropriately, it does not display in the confirmation view. step_id[] is a series of checkboxes, that have the same name (step_id[]), I do not know how to store that array of values into the $data['steps'] array, to be passed into the confirmation view.
View
Code:
<h3>Department</h3>
<p><?=$department_id?></p>
<h3>Message</h3>
<pre><?=$message?></pre>
<h3>Steps</h3>
<?php print_r($steps); ?>
Resolved; Had to take the [] out of step_id in the post, so now it works with
$data['steps'] = $this->input->post('step_id');
If there is a better way to do this, I am still all ears.