PHPackages                             depa/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. depa/dot-navigation

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

depa/dot-navigation
===================

DotKernel navigation component

v3.3.7(2y ago)046MITPHPPHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0

Since Mar 9Pushed 2y agoCompare

[ Source](https://github.com/depa-berlin/dot-navigation)[ Packagist](https://packagist.org/packages/depa/dot-navigation)[ Docs](https://github.com/dotkernel/dot-navigation)[ RSS](/packages/depa-dot-navigation/feed)WikiDiscussions 3.0 Synced today

READMEChangelog (10)Dependencies (10)Versions (22)Used By (0)

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

[](#dot-navigation)

Allows you to easily define and parse menus inside templates, configuration based approach.

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

[](#installation)

Run

```
$ 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)

In your `config/autoload` directory, create a config file

##### navigation.global.php

[](#navigationglobalphp)

```
return [
    'dot_navigation' => [
        //enable menu item active if any child is active
        'active_recursion' => true,

        //map a provider name to its config
        'containers' => [
            'default' => [
                'type' => 'ArrayProvider',
                'options' => [
                    'items' => [
                        [
                            'options' => [
                                'label' => 'Menu #1',
                                'route' => [
                                    'route_name' => 'home',
                                    'route_params' => [],
                                    'query_params' => [],
                                    'fragment_id' => null,
                                    'options' => [],

                                    //the below parameters are not used in route generation
                                    //they are used in finding if a page is active by omitting some parameters from the check
                                    'ignore_params' => []
                                ],
                            ],
                            'attributes' => [
                                'name' => 'Menu #1',
                            ]
                        ],
                        [
                            'options' => [
                                'label' => 'Menu #2',
                                'route' => ['route_name' => 'home'/*,...*/],
                            ],
                            'attributes' => [
                                'name' => 'Menu #1',
                            ]
                        ]
                    ],
                ],
            ],
        ],

        //register custom providers here
        'provider_manager' => [],
    ],
];
```

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 defines each navigation item.

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

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

Attributes are key value pairs that defines 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 container. 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 ul 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, 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, in order to omit menu items that are not authorized to visit.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 75.8% of commits — single point of failure

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 ~144 days

Recently: every ~10 days

Total

19

Last Release

799d ago

Major Versions

0.2.1 → v1.0.02018-05-15

v1.0.0 → v2.0.02020-01-30

2.0.x-dev → v3.0.02020-04-17

PHP version history (6 changes)0.1.0PHP ^7.1

v2.0.0PHP ^7.2

v3.0.0PHP ^7.4

v3.3.0PHP ^7.4 || ~8.1.0 || ~8.2.0

v3.3.2PHP ~8.1.0 || ~8.2.0 || ~8.3.0

v3.3.3PHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/098d961636811c2bb7c97ec9f73d350027f1ccc51651f392b0c88da83dfb2fe6?d=identicon)[microf-berlin](/maintainers/microf-berlin)

---

Top Contributors

[![n3vrax](https://avatars.githubusercontent.com/u/5805542?v=4)](https://github.com/n3vrax "n3vrax (25 commits)")[![arhimede](https://avatars.githubusercontent.com/u/22009710?v=4)](https://github.com/arhimede "arhimede (4 commits)")[![gabidj](https://avatars.githubusercontent.com/u/3998573?v=4)](https://github.com/gabidj "gabidj (4 commits)")

---

Tags

containerlaminasmezzionavigationfactories

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M124](/packages/mezzio-mezzio)[laminas/laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria

15848.2M220](/packages/laminas-laminas-validator)[mezzio/mezzio-authentication-oauth2

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

28591.3k3](/packages/mezzio-mezzio-authentication-oauth2)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

587.2M100](/packages/laminas-laminas-stratigility)[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)
