I am using code igniter and I am trying to send multiple arrays to view
this is multiple array in controller I pass this array to view
$data=Array (
[email] => Array (
[abv] => Array (
[name] => Abv
[version] => 1.0.7
[description] => Get the contacts from a Abv account
[base_version] => 1.8.4
[type] => email
[check_url] => http://m.abv.bg
[requirement] => email
[allowed_domains] => Array (
[0] => /(abv.bg)/i
[1] => /(gyuvetch.bg)/i
[2] => /(gbg.bg)/i
)
[imported_details] => Array (
[0] => first_name
[1] => email_1
)
)
)
)
$this->load->view('view', $data)
This is view,
<?php
foreach($data as $type=>$providers) {
if ($type == 'email')
"<optgroup label='email group'>"
else
"<optgroup label='social group'>";
foreach ($providers as $provider=>$details)
"<option value='{$provider}'".($_POST['provider_box']==$provider?' selected':'').">{$details['name']}</option>";
开发者_高级运维 "</optgroup>";
}
?>
It dose print out anything. can you explain why it dosent work?
You're missing the echos, that might explain why nothing prints out. For example:
echo "<optgroup label='email group'>";
精彩评论