trendwerk / submenu
Submenu for Timber.
Installs: 2 001
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 6
Open Issues: 0
Requires
- php: >=7
- timber/timber: *
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-29 04:30:38 UTC
README
Submenu for Timber.
Installation
composer require trendwerk/submenu
Usage
- Add a new instance of Submenu to Timber's context
- Use it like you would use a
Timber\MenuItem
Parameters
$submenu = new Submenu($menu);
Example
Add a new instance of Submenu to your context:
use Trendwerk\Submenu\Submenu; ... $context['submenu'] = new Submenu($menu);
Use submenu
as you would use a Timber\MenuItem
.
{% if submenu.children %} <h3>{{ submenu.title }}</h3> <ul> {% for item in submenu.children %} <li>{{ item.title }}</li> {% endfor %} </ul> {% endif %}