[eluser]breaddes[/eluser]
I worry about my Navigation System. The following is a common asset, that I include in every View. I'm not sure if this is a proper way to do a Navigation. I can loop the items in foreach or something else, but what would you recommend?
Code:
<ul id="navi">
<?php $seg = $this->uri->segment(1); ?>
<li class=<?php if($seg=='home' | empty($seg)): ?>"active"<?php else: ?>"inactive"<?php endif; ?>
<a href="<?=base_url() ?>home"><?=$this->lang->line('home')?></a>
</li>
<li class=<?php if($seg=='glossary'): ?>"active"<?php else: ?>"inactive"<?php endif; ?>
<a href="<?=base_url() ?>glossary"><?=$this->lang->line('glossary')?></a>
</li>
<li class=<?php if($seg=='disclaimer'): ?>"active"<?php else: ?>"inactive"<?php endif; ?>
<a href="<?=base_url() ?>disclaimer"><?=$this->lang->line('disclaimer')?></a>
</li>
</ul>