Eduardo Fuerte
asked on
Could you point how to correctly present an already obtained array from CodeIgniter's model in the View?
Hi Experts
Could you point how to correctly present an array already obtained from CodeIgniter's model in the View?
Controller's code:
Model's Code:
View's code
Debbuging, the array is correctly obtained in the view:
The combo is functional but the names (nome_seguradora) doesn't appears.
Could you point a workaround on this?
Thanks in advance!
Could you point how to correctly present an array already obtained from CodeIgniter's model in the View?
Controller's code:
$this->data['fk_seguradora_f'] = $this->seguradora_model->get_seguradoras();
Model's Code:
function get_seguradoras( )
{
$fk_seguradora_f = array();
$query=$this->db->query("SELECT id_seguradora, nome_seguradora FROM system_seguradora");
$fk_seguradora_f = $query->result_array();
return $fk_seguradora_f;
}
View's code
<div class="row">
<div class="col-xs-12 mb15">
<div class="input-group">
<span class="input-group-addon ">
<i class="fa fa-search c-gray"></i>
</span>
<!--EF Jan/2017 - Campo de filtro dinamicamente formado --->
<span class="select">
<select id="fk_seguradora" name="fk_seguradora">
<?php
var_dump('testeyyy'); // just to locate the code easily.
var_dump($fk_seguradora_f);
die;
foreach($fk_seguradora_f as $each)
{
?>
<option value="<?=$each['id_seguradora']?>"><? echo $each['nome_seguradora']?></option>
<?php
}
?>
</select>
</span>
</div>
</div>
</div>
Debbuging, the array is correctly obtained in the view:
The combo is functional but the names (nome_seguradora) doesn't appears.
Could you point a workaround on this?
Thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for help.
ASKER
Correct
Open in new window
Incorrect:
Open in new window