<?php if (!empty($products)): ?>
<ul>
    <?php foreach ($products as $p): ?>
    <li>
        <a href="<?php echo $view['router']->generate('categories', array(), false) ?>">
            <?php echo $p['title'] ?>
        </a>    
        <?php echo $p['sub'] ?>
    </li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>