# KnpLabs/KnpMenu

Menu Library for PHP

Repository: https://github.com/KnpLabs/KnpMenu
Canonical: https://ross.abutalabs.com/products/knpmenu
Homepage: https://knplabs.com
Language: PHP
License: MIT
License Family: permissive
Topics: php, menu
Last push: 2026-08-21T07:26:09+00:00

## Health v2 (maintenance only)
Score: 74/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 28, longevity 100
- inputs: {"age_days": 5504, "days_push": 12, "days_rel": 446, "gap_med": 87.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1394, forks 190 (observed 2026-08-28T04:04:36.397103+00:00)

## What it is
KnpMenu is an object-oriented menu library for PHP that lets developers build and render navigation menus programmatically. It is used standalone or via KnpMenuBundle in Symfony applications, handling current-item highlighting, first/last classes, and submenus.

## Use cases
- build navigation menus in PHP without hand-writing HTML templates
- render menus with current item highlighting in Symfony apps
- create nested submenus programmatically
- integrate menu rendering with Twig templates
- reuse menu definitions across multiple pages

## When to choose
- you need structured, reusable navigation menus in a PHP or Symfony project
- you want automatic current-item and first/last CSS classes instead of manual templating
- you need hierarchical menus with children rendered as nested lists

## When to avoid
- you only need a simple static menu that a template can hardcode
- your frontend framework builds navigation client-side
- you need a full CMS-style menu management UI

## Facets
- artifact type: library
- maturity: stable
- function: templating, ui-components
- domain: web-development
- platform: php
- tags: menus, navigation, symfony, html-rendering, php, web-server

## Member repositories
- KnpLabs/KnpMenu (main) score 74

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:36.397103+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:39:25.524197+00:00, confidence not recorded.
  - readme: https://github.com/KnpLabs/KnpMenu (fetched 2026-08-28T04:04:36.397103+00:00, sha de45448b56b1)
  - homepage: https://knplabs.com (fetched 2026-08-29T11:54:06.705146+00:00, sha 3e099e7188ae)
- Data as of 2026-08-30T08:39:29.467469+00:00.
