The following function out-puts an array and html.
I don't want to have
<li><a href="http://127.0.0.1/ci_okadadesign/index.php/admin/menus/r">r</a></li>
Could anyone tell me how to achive it please?
Function
function getTopMenus(){
$data[0] = 'root';
$this->db->where('parentid',0);
$Q = $this->db->get('menus');
if ($Q->num_rows() > 0){
foreach ($Q->result_array() as $row){
$data[] = $row;
}
}
$Q->free_result();
return $data;
}
print_r():
Array (
[0] => Array (
[id] => 24
[name] => Main menu
[shortdesc] => mainmenu
[status] => active
[parentid] => 0
)
[1] => Array (
[id] => 25
[name] => Galleri 1
[shortdesc] => galleri1
[status] => active
[parentid] => 0
)
)
HTML:
<li><a href="http://127.0.0.1/ci_okadadesign/index.php/admin/menus">menus</a>
<ul>
<li><a href="http://127.0.0.1/ci_okadadesign/index.php/admin/menus/r">r</a></li>
<li><a href="http://127.0.0.1/ci_okadadesign/index.php/admin/menus/mainmenu">Main menu</a></li>
<li><a href="http://127.0.0.1/ci_okadadesign/index.php/admin/menus/galleri1">Galleri 1</a></li>
</ul>