Creating a horizontal menu in CodeIgniter is a lot like creating it with plan HTML, only you're using CI helpers to create the anchors. A simple menu would be created like this:
<ul id="menu">
<li><?php echo anchor('controller/action', 'Link Text'); ?></li>
<li><?php echo anchor('controller/action', 'Link Two'); ?></li>
<li><?php echo anchor('controller/action', 'Link Three'); ?></li>
</ul>
The anchor
helper will produce a link, so your menu items will output like this:
<li><a href="controller/action">Link Text</a></li>
Once you create the menu you can style it with CSS like any other menu. In place of the anchor
helper you can use any of the other URL helpers like current_url
or index_page
.
You're not required to use the URL helpers when creating a menu, so if you have a static menu you could use plain HTML to create it.