openfinancy / admin-menu-component
Composite-based admin menu building blocks shared across OpenFinancy projects.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
pkg:composer/openfinancy/admin-menu-component
Requires
- php: >=8.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.59
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^12.4
This package is auto-updated.
Last update: 2025-11-12 07:00:12 UTC
README
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.
Installation
composer require openfinancy/admin-menu-component:^0.1
The component targets PHP 8.4+ and contains no Symfony-specific dependencies, making it reusable in any PHP application that relies on composite menu trees.
Key Features
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.
Usage
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.
Development
Run the bundled Composer scripts before submitting changes:
composer test
composer analyse
composer lint
The scripts execute PHPUnit, PHPStan and PHP-CS-Fixer respectively.
Documentation
CHANGELOG.mdtracks release history.- The
tests/directory demonstrates expected behaviour.
License
Distributed under the European Union Public Licence v1.2 (EUPL-1.2). See the LICENSE file for the full text.