Use a helper and/or a partial to generate the menu. So lets say you have a partial _navigation.php in the module 'default':
// in layout:
<?php include_partial('default/navigation', array(
'navigation'=>$array,
'active'=>has_slot('navigationActiveUrl')
? get_slot('navigationActiveUrl')
: null)
); ?>
// in modules/default/templates/_navigation.php
<?php if(isset($navigation)): ?>
<ul>
<?php foreach($navigation as $name => $url): ?>
<?php echo content_tag('li', link_to($name, $url), array('class' =>
(isset($active) && $active == $url ? 'active' : null)
)); ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
// in some template file:
<?php slot('navigationActiveUrl'); ?>/internal/uri<?php end_slot(); ?>
you could also just use a helper and hard code the html in there if you wont need to modify it much. using a partial simply gives you an easy way to change the markup without changing the helper function. Like wise you could make a helper function and still have it call the same partial.