PHPackages                             dotkernel/dot-navigation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. dotkernel/dot-navigation

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

dotkernel/dot-navigation
========================

Dotkernel navigation component

4.2.0(8mo ago)631.1k↑121.4%3[3 issues](https://github.com/dotkernel/dot-navigation/issues)3MITPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI failing

Since Mar 9Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/dotkernel/dot-navigation)[ Packagist](https://packagist.org/packages/dotkernel/dot-navigation)[ Docs](https://github.com/dotkernel/dot-navigation)[ RSS](/packages/dotkernel-dot-navigation/feed)WikiDiscussions 4.0 Synced 2d ago

READMEChangelog (10)Dependencies (11)Versions (27)Used By (3)

dot-navigation
==============

[](#dot-navigation)

`dot-navigation` is Dotkernel's component that allows you to easily define and parse menus inside templates, using a configuration-based approach.

Documentation
-------------

[](#documentation)

Documentation is available at: .

Badges
------

[](#badges)

[![OSS Lifecycle](https://camo.githubusercontent.com/159772a56076655745bd2bd65f43642a778b6fd9edc8401044e52efc950f336b/68747470733a2f2f696d672e736869656c64732e696f2f6f73736c6966656379636c652f646f746b65726e656c2f646f742d6e617669676174696f6e)](https://camo.githubusercontent.com/159772a56076655745bd2bd65f43642a778b6fd9edc8401044e52efc950f336b/68747470733a2f2f696d672e736869656c64732e696f2f6f73736c6966656379636c652f646f746b65726e656c2f646f742d6e617669676174696f6e)[![PHP from Packagist (specify version)](https://camo.githubusercontent.com/334a9e229ca35121613efad9d3b004fb06a83919740e70966a24494484903049/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f746b65726e656c2f646f742d6e617669676174696f6e2f342e322e30)](https://camo.githubusercontent.com/334a9e229ca35121613efad9d3b004fb06a83919740e70966a24494484903049/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f746b65726e656c2f646f742d6e617669676174696f6e2f342e322e30)

[![GitHub issues](https://camo.githubusercontent.com/94356f399e825dde43aa3599d187c82a51b9af9ab73b9a357fb3895b76010a99/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f646f746b65726e656c2f646f742d6e617669676174696f6e)](https://github.com/dotkernel/dot-navigation/issues)[![GitHub forks](https://camo.githubusercontent.com/e1a35e29c0e6e2fe4b280e0e58430040b33db5b9a8e3cbd759d4f3daca16e296/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f646f746b65726e656c2f646f742d6e617669676174696f6e)](https://github.com/dotkernel/dot-navigation/network)[![GitHub stars](https://camo.githubusercontent.com/eac781427dffeedc50593155b1b95d741677039642b443ed17d921f116222777/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f646f746b65726e656c2f646f742d6e617669676174696f6e)](https://github.com/dotkernel/dot-navigation/stargazers)[![GitHub license](https://camo.githubusercontent.com/ad7e1d463cbe5a10795aa0c05109f13b6a944ccffd0d9384dcedf81d6726e934/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646f746b65726e656c2f646f742d6e617669676174696f6e)](https://github.com/dotkernel/dot-navigation/blob/4.0/LICENSE.md)

[![Build Static](https://github.com/dotkernel/dot-navigation/actions/workflows/continuous-integration.yml/badge.svg?branch=4.0)](https://github.com/dotkernel/dot-navigation/actions/workflows/continuous-integration.yml)[![codecov](https://camo.githubusercontent.com/9ac4540474f426bae4790bca60d66cd60022031481e87aece219ac88d5800e12/68747470733a2f2f636f6465636f762e696f2f67682f646f746b65726e656c2f646f742d6e617669676174696f6e2f67726170682f62616467652e7376673f746f6b656e3d41493957465944445839)](https://codecov.io/gh/dotkernel/dot-navigation)[![PHPStan](https://github.com/dotkernel/dot-navigation/actions/workflows/static-analysis.yml/badge.svg?branch=4.0)](https://github.com/dotkernel/dot-navigation/actions/workflows/static-analysis.yml)

Installation
------------

[](#installation)

Install `dotkernel/dot-navigation` by executing the following Composer command:

```
composer require dotkernel/dot-navigation
```

Merge `ConfigProvider` to your application's configuration.

> The package uses dot-helpers package, please merge dot-helpers `ConfigProvider` to your application's configuration also, if it's not merged already!

Register `NavigationMiddleware` in your middleware pipe between the routing and the dispatching middleware.

Configuration
-------------

[](#configuration)

Locate dot-navigation's distributable config file `vendor/dotkernel/dot-navigation/config/autoload/navigation.global.php.dist` and duplicate it in your project as `config/autoload/navigation.global.php`

Components
----------

[](#components)

A menu, or navigation container, is a class implementing the `RecursiveIterator` interface. It has a hierarchical structure, with nodes called pages (see the `Page` class) that may have children. It is basically a tree

A Page extends the NavigationContainer class. The NavigationContainer is the top most node which represents the entire menu. The children of this node are Page instances that define each navigation item.

A page has a reference to its parent and can have options and attributes. There is no limitation on what is accepted as options or attributes.

Options can be any piece of information that describes a page. Some predefined options exist in order for the navigation module to work seamlessly with other dot modules.

Attributes are key value pairs that define the menu item. They are usually inserted as HTML attributes when parsing the menu, but of course, this is implementation-specific.

A `NavigationService` class, is the service that handles all defined menu containers. It can fetch the container from its provider, check if a page is active or not, and get the page's generated URI.

Container providers
-------------------

[](#container-providers)

Each menu can be created from different sources. The responsibility of creating a menu container from the source falls on a container provider.

Each provider must implement the interface `ProviderInterface` and be registered in the ProviderPluginManager.

We offer just one provider for now, `ArrayProvider`, that is able to fetch and create a menu container from a php array that is defined in the configuration file.

NavigationRenderer
------------------

[](#navigationrenderer)

Used to render the navigation container in a displayable format. It can render a simple HTML unordered list or use a partial template to render the menu in a template engine.

The partial method is usually the more flexible one, custom rules can be defined and checked in the template.

If you are using Twig, there is already a Twig extension provided in package dot-twigrenderer that you can use to easily parse the menus inside your templates

When using the partial method, the template will receive as parameters the container, the navigation service, and any extra parameters set by the developer.

Navigation containers are referred to, when parsed, by their name, as defined in the configuration file.

Required page options and attributes
------------------------------------

[](#required-page-options-and-attributes)

The following are options that each page should define in the configuration

- `label` - the text of the menu item
- `route` or `uri` - defines the route or link the menu item will have
- `permission` - can be used optionally if authorization service is present, to omit menu items that are not authorized to visit.

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance52

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~122 days

Recently: every ~64 days

Total

27

Last Release

229d ago

Major Versions

0.2.1 → v1.0.02018-05-15

v1.0.0 → 2.0.x-dev2020-01-30

v2.0.0 → v3.0.02020-04-17

3.5.1 → 4.0.02025-01-20

3.6.0 → 4.0.x-dev2025-11-17

PHP version history (8 changes)0.1.0PHP ^7.1

2.0.x-devPHP ^7.2

v3.0.0PHP ^7.4

3.2.0PHP ^7.4 || ~8.0.0 || ~8.1.0

3.4.0PHP ~8.1.0 || ~8.2.0

3.4.2PHP ~8.1.0 || ~8.2.0 || ~8.3.0

4.0.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

4.2.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1156873?v=4)[Dotkernel](/maintainers/dotkernel)[@dotkernel](https://github.com/dotkernel)

---

Top Contributors

[![n3vrax](https://avatars.githubusercontent.com/u/5805542?v=4)](https://github.com/n3vrax "n3vrax (25 commits)")[![alexmerlin](https://avatars.githubusercontent.com/u/4542449?v=4)](https://github.com/alexmerlin "alexmerlin (23 commits)")[![arhimede](https://avatars.githubusercontent.com/u/22009710?v=4)](https://github.com/arhimede "arhimede (12 commits)")[![gabidj](https://avatars.githubusercontent.com/u/3998573?v=4)](https://github.com/gabidj "gabidj (4 commits)")[![bidi47](https://avatars.githubusercontent.com/u/27284979?v=4)](https://github.com/bidi47 "bidi47 (2 commits)")[![Howriq](https://avatars.githubusercontent.com/u/63609103?v=4)](https://github.com/Howriq "Howriq (2 commits)")[![Jurj-Bogdan](https://avatars.githubusercontent.com/u/53825374?v=4)](https://github.com/Jurj-Bogdan "Jurj-Bogdan (2 commits)")[![AtomicXtreme](https://avatars.githubusercontent.com/u/95294714?v=4)](https://github.com/AtomicXtreme "AtomicXtreme (1 commits)")

---

Tags

containerlaminasmezzionavigationfactories

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dotkernel-dot-navigation/health.svg)

```
[![Health](https://phpackages.com/badges/dotkernel-dot-navigation/health.svg)](https://phpackages.com/packages/dotkernel-dot-navigation)
```

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M126](/packages/mezzio-mezzio)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28591.3k3](/packages/mezzio-mezzio-authentication-oauth2)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[elie29/zend-phpdi-config

PSR-11 PHP-DI autowire container configurator for Laminas, Mezzio, ZF2, ZF3 and Zend Expressive applications

19248.3k8](/packages/elie29-zend-phpdi-config)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
