[eluser]gscharlemann[/eluser]
I tried a new angle and created the following array in the controller:
Code:
$person_1 = array();
$person_2 = array();
$person_1['contact_number'] = 1;
$person_1['first_name'] = "John";
$person_1['last_name'] = "Doe";
$person_2['contact_number'] = 2;
$person_2['first_name'] = "Jane";
$person_2['last_name'] = "Doe";
$people_array = array();
$people_array[0] = $person_1;
$people_array[1] = $person_2;
I verify the contents of the array using the fred() function provided earlier in this thread. The result is:
Code:
$msg_name not passedArray
(
[0] => Array
(
[contact_number] => 1
[first_name] => John
[last_name] => Doe
)
[1] => Array
(
[contact_number] => 2
[first_name] => Jane
[last_name] => Doe
)
)
I then make a call to load the view and try to pass $people_array:
Code:
$this->load->view('contact/display_people', $people_array);
I don't do anything special in the view (should I?). The first php call I make is the foreach statement below:
Code:
<?php foreach($people_array as $person): ?>
<tr>
<td><?php echo $person['contact_id'];?></td>
<td><?php echo $person['first_name'];?></td>
<td><?php echo $person['last_name'];?></td>
</tr>
<?php endforeach;?>
Is there something that I'm not doing in the view that I should be doing? Do I need to define what parameters can be passed to it? Or if I wanted to pass an additional variable to the view, would it simply be modifying the call to load the view, for example:
Code:
$this->load->view('contact/display_people', $people_array, $test_var);
Thanks again for all your help.