<?php
echo '<ul>';

$menu_items = menu_item::get_list($module['data']->menu_id);
$i = 0;

foreach ($menu_items as $menu_item) {
    $class = '';
    
    if ($i == 0) {
        $class .= ' first';
    }
    
    if ((count($menu_items) - 1) == $i) {
        $class .= ' last';
    }
    
    $i++;
    
    echo '<li class="' . trim($class) . '">';
    include fractal::find('menu/' . $menu_item['type_alias'] . '.php');
    echo '</li>';
}

echo '</ul>';
