[eluser]ramm[/eluser]
Hi
I'm working on a simple navigation helper to place a navigation menu anywhere i need it and having the current section selected, and i need a way to define the array with the menu structure to pass it to the helper.
Where should i save that array to be available for the helper?
It will look something like this:
Code:
$items = array(
'home' => array(
'id' => 'home',
'title' => 'Home',
'link' => ''
),
'about' => array(
'id' => 'about',
'title' => 'About Us',
'link' => 'aboutus'
),
'services' => array(
'id' => 'service',
'title' => 'Services',
'link' => 'services'
),
'contact' => array(
'id' => 'contact',
'title' => 'Contact Us',
'link' => 'contact'
)
);
Then i can call the menu:
Code:
<?php echo menu('about'); ?>
Or in the controller
Code:
$data['menu'] = menu('about');
And it will show the complete menu with the 'about' li set with the 'current' class.
Any ideas?