Submenu in Vokuro


Totaly new to Phalcon and trying to use Vokuro, I love how simple its menu system is and want to craete a submenu but dont know how, would anyone be able to guide me please. below is the code I believe I need to change:

{%- set menus = [ 'Home': null, 'Users': 'users',
'Profiles': 'profiles', 'Permissions': 'permissions', ] -%}

Thank you in advance

You could try using a multidimensional array to define the submenus. Like this:

{%- set menus = [
    'Home': 'index',
    'About': ['about', [
        'SubItem1': 'link1',
        'SubItem2': 'link2'
] -%}

And then print the menu items like this:

{%- macro render_menu_items(menu_items) %}
    {% for key, value in menu_items %}
        {% if value is type('array') %}
                {{ link_to(value[0], key) }}
                <ul class="nav-submenu">
                    {{ render_menu_items(value[1]) }}
        {% else %}
            <li>{{ link_to(value, key) }}</li>
        {% endif %}
    {% endfor %}
{%- endmacro %}

{{ render_menu_items(menus) }}

Then of course you have to handle the show/hide functionality of the submenu, either with CSS or Javascript.

Perfect thank you