menu
menu copied to clipboard
How to build menu from multi dimension array?
I'm struggling to build a menu for this below array
$menu_items = Array(
0 => Array(
"id" => 1,
"text" => "Home",
"href" => "#home",
"columns" => 0
),
1 => Array(
"id" => 2,
"text" => "About",
"href" => "#",
"columns" => 0,
"children" => Array(
0 => Array(
"id" => 3,
"text" => "Menu Item 1",
"href" => "#",
),
1 => Array(
"id" => 4,
"text" => "Menu Item 2",
"href" => "#",
)
)
),
2 => Array(
"id" => 5,
"text" => "Something else here",
"href" => "#",
"columns" => 0
),
);