What will happen with laminas-navigation?

laminas-mvc will be marked as security-only soon and the development we stop.

But what will happen to laminas-navigation? It relies a lot on laminas-mvc, and it can not be used with mezzio.

I would hope that it would be refactored to support Mezzio.

Only the page type Mvc and the related factories. But it is correct that the laminas-navigation does not work with Mezzio – Unfortunately, no one was interested in contributing anything either.

But you have your own library. :winking_face_with_tongue:


The view helpers have already been removed from laminas-view:

The basic idea is to make the navigation package independent so that it can be used in any application which supports PSR-7. In addition, routers are also supported, such as those offered by Mezzio. (But there is no need for different page types for this.)

The package should also support different template engines via satellite packages. The HTML would be created by the laminas-navigation component and then there would be simple integrations in different template engines. laminas-view is one of them and then Plates, Twig, etc. – like we have in Mezzio.

Full support of web accessibility will also be added.

The access to pages would be handled by PHPā€˜s FilterIterator for different systems. And the navigation container is filtered before it is given to the HTML generation and template engine.

Many dependency will be removed from the main package laminas-navigation:

  • laminas-config
  • laminas-http
  • laminas-i18n
  • laminas-mvc
  • laminas-permissons-acl
  • laminas-router
  • laminas-servicemanager
  • laminas-uri
  • laminas-view

Those are the plans/ideas I have so far.

1 Like

What is the plan for providing a hook into the overall filtering mechanism for allowing extension for components like ACL/RBAC that are not included to filter the container?

With access to pages I mean ACL/RBAC or something similar.
Invisible/hidden pages are also filtered out.

1 Like

Is there a proposal for the changes to Laminas Navigation as yet? If not would it be possible to contribute to it?

@simon-mundy
Do you have concrete ideas or questions? We can collect all ideas and requests and then track them in a project on GitHub.

Hi @froschdesign I do have a few that spring to mind :slight_smile:

  • Remove namespace requirement to access a container. I’d like a App\Navigation\MainMenu for example. If it’s already possible then maybe we need to improve documentation.
  • Obviously native support for Mezzio View PhpRenderer. Probably also Twig and even Plates. I can’t imagine they’d be too hard to configure.
  • Ability to specify whether ā€˜active’ can be applied to the li in a ul-style list. And also perhaps for custom types using div.
  • Ability to more easily decorate or provide decorators via ServiceManager for the view helpers. I need to be able to add classes/attributes to ul, li, AND a - modern HTML5 like:- href, target, rel, title, id, class, name, hreflang, type, download, referrerpolicy, ping, aria-label, aria-labelledby, aria-current, role, tabindex, data-*, fetchpriority, importance, anchor, popover-target, blocking.
  • Perhaps also some more recipes or templates for menu types. E.g. being able to grab all top-level nav pages from a container, then in a subsequent subnav then being able to grab all 2nd-level based on the active top-level (i.e. for CSS or JS filtering). I will have to find a specific use-case for this, I know I’ve run into it before when building sites.
  • Haven’t tested this for a while but I know that the ACL checks were being called 3 times per individual page even when no ACL object had been injected.
  • Use the ServiceManager to inject an ACL instance into Laminas\Navigation automatically and subsequently the view helpers. Because we may wish to query resource availability even without the view helpers.

That’s a start. I’ll think about some more. Clearly some of this is core, some of it is view-helper-specific.

Please think bigger, because there will be a new major version and everything will be revised.
Support for laminas-mvc will be removed and the basic navigation component will be opened up for other applications/frameworks, including Mezzio. I wouldn’t nail down the DI container either; it should run with any PSR container implementation.

To address your points: The application’s general service container is no longer required to retrieve a navigation container. There are also no longer any checks for permissions at the view layer or directly in the container; this can be resolved by filtering. This also allows an easy implementation of other libraries or systems. When setting HTML attributes, it follows the laminas-form component, where there are no restrictions on setting. And, of course, various template engines should be supported, so it will be necessary to check whether rendering in pure HTML without an engine would be better in order to avoid repetitions in the various engines.

I will create some issue reports and collect the ideas. Then I will create a project on GitHub.
Thank you in advance for your interest and contributions. Please feel free to create your own issue reports as feature requests, so that I can incorporate them into the project.

Not sure how much bigger to think! Generally speaking Navigation works well for me, and the points above are more about implementation at a granular level.

I don’t want it tied to the ServiceManager but I do want the convenience of being able to compose one very simply.

I would veer away from creating raw HTML within a view helper if possible. I think leveraging existing template helpers in each of the template types would be far more beneficial.

But yes that sounds great re: creating a project and gathering more feedback. Please put my name down for any help required.