Composite-based menu primitives shared across the OpenFinancy Symfony services. The package exposes lightweight tree objects (MenuGroup, MenuLink, etc.) under the OpenFinancy\Component\AdminMenu namespace so each project can render consistent administration navigation without re-implementing the pattern.
composer require openfinancy/admin-menu-component:^0.1The component targets PHP 8.4+ and contains no Symfony-specific dependencies, making it reusable in any PHP application that relies on composite menu trees.
MenuComponentinterface andAbstractMenuComponentbase class implementing the composite pattern.- Concrete
MenuGroupandMenuLinktypes for hierarchical navigation structures. - Immutable value objects with typed children for simple serialisation or templating.
- Thorough PHPUnit coverage to ensure behaviour remains stable across projects.
use OpenFinancy\Component\AdminMenu\MenuGroup;
use OpenFinancy\Component\AdminMenu\MenuLink;
$menu = [
new MenuGroup('Dashboard', 'bi bi-speedometer2', [
new MenuLink('Overview', 'bi bi-graph-up', 'admin_dashboard'),
new MenuLink('Health', 'bi bi-heart-pulse', 'admin_health'),
]),
new MenuGroup('Configuration', 'bi bi-sliders', [
new MenuLink('Service Settings', 'bi bi-gear', 'admin_service_configuration'),
]),
];Render the resulting structure using Twig, Blade, or your templating engine of choice.
Run the bundled Composer scripts before submitting changes:
composer test
composer analyse
composer lintThe scripts execute PHPUnit, PHPStan and PHP-CS-Fixer respectively.
CHANGELOG.mdtracks release history.- The
tests/directory demonstrates expected behaviour.
Distributed under the European Union Public Licence v1.2 (EUPL-1.2). See the LICENSE file for the full text.