Skip to main content

Installation

Install via Composer and get up and running in minutes with Symfony Flex or manual setup.

Quickstart

Create your first menu, render it in Twig, and query it via the JSON API.

Configuration

Configure Doctrine connection, cache, locales, icons, and the admin dashboard.

API Reference

Explore Twig functions, the JSON API endpoint, and PHP interfaces.

What is Nowo Dashboard Menu Bundle?

Nowo Dashboard Menu Bundle is a Symfony bundle that gives you database-driven, configurable navigation menus for your dashboard applications. Menus are stored in the database with a tree structure (parent/children ordered by position), support multiple locales via JSON translations, and can be filtered per-user with a permission checker. You render menus in Twig with a single function call or consume them from a React/Vue SPA via a JSON API endpoint. An admin dashboard at /admin/menus lets you create, edit, copy, and export/import menus without writing code.
No external ORM extensions (Gedmo, Stof, or similar) are required. The bundle works with standard Doctrine ORM ^2.13 || ^3.0.

Key features

Tree structure

Hierarchical menus with parent/children relationships, ordered by position. Unlimited depth with optional depth limit per menu.

Context resolution

The same menu code can have multiple variants (e.g. per partner or operator). Pass ordered context sets and the first match is used.

i18n translations

Per-locale JSON labels stored on each menu item. No separate translation files — translations live in the database alongside the item.

Permission filtering

Implement MenuPermissionCheckerInterface and tag it — items that fail the check are automatically pruned from the tree, including empty parents.

Twig rendering

Three Twig functions: dashboard_menu_tree(), dashboard_menu_config(), and dashboard_menu_href(). Include the bundle template or override it.

JSON API

GET /api/menu/{code} returns the full tree as JSON for SPA consumption. Supports locale override and context sets via query params.

Admin dashboard

Full CRUD at /admin/menus. Create, edit, copy, export and import menus as JSON. Forms split into definition and configuration panels.

PSR-6 cache

Configurable TTL and cache pool. Two SQL queries per menu load — menu + items — with the tree built in PHP.

Compatibility

RequirementVersion
PHP>= 8.2, < 8.6
Symfony6.4 (LTS), 7.x, 8.x
Doctrine ORM^2.13 || ^3.0
Symfony 8.0 requires PHP >= 8.4. With PHP 8.2 or 8.3, Composer resolves to Symfony 6.4 or 7.x automatically.

Quick example

composer require nowo-tech/dashboard-menu-bundle
{# In any Twig template #}
{% set tree = dashboard_menu_tree('sidebar') %}
{% set config = dashboard_menu_config('sidebar') %}
{% include '@NowoDashboardMenuBundle/menu.html.twig' with {
    menuTree: tree,
    menuCode: 'sidebar',
    menuConfig: config
} %}
# JSON API for SPA apps
GET /api/menu/sidebar

Get started

Install the bundle and configure your first menu in under 10 minutes.

Core concepts

Understand the Menu and MenuItem entities, tree structure, and context resolution.