[eluser]Mainboard[/eluser]
well, i create a dynamic menu with a db, and this is my code:
My model
Code:
<?
class menu_enc_model extends CI_Model {
function call_menu_enc() {
$q = $this->db->select('*')->from('tb_menu_enc')->where('activo', 1);
$ret['rows_enc'] = $q->get()->result();
return $ret;
}
}
?>
My Control (call site.php)
Code:
function members_area() {
$this->load->model('menu_enc_model');
$results_enc = $this->menu_enc_model->call_menu_enc();
$data['menu_enc'] = $results_enc['rows_enc'];
$this->load->view('index', $data);
}
And View
Code:
<?php foreach($menu_enc as $menue): ?>
<? echo '<a class="current">link.' target='.$menue->destino.'>'.$menue->nombre_enc.'</a>';?>
<?php endforeach; ?>
i dont' know why doesn't appear the href but the code is href='.$menue->link.' target=...
everything works perfect except when I press some button of the menu, automatically returns to my control (site.php) waiting some function, so i want to return to some view, not to my control, so how i can to create a function to return each view in each button?