Download the PHP package depa/middleware-navigation without Composer
On this page you can find all versions of the php package depa/middleware-navigation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download depa/middleware-navigation
More information about depa/middleware-navigation
Files in depa/middleware-navigation
Package middleware-navigation
Short Description The middleware navigation is a PSR-15 middleware that provides navigation functionality to a Zend Expressive application
License MIT
Homepage https://github.com/depa-berlin/Middleware-Navigation
Informations about the package middleware-navigation
Middleware-Navigation
Installation
Run the following to install this library:
Documentation
After installing the module, you have to implement the navigation-middleware into your pipeline, so you basically add this line above the RouteMiddleware:
To create a navigation, use the navigation.global.php (it's inside the config folder) as your basic (put it into config\autoload)
The basic structure of a menu-item must look like this:
if you want to add attributes to a menu-item (to the ul element), do this:
if you want to add link-attributes to a menu-item (to the a element), do this:
if you want to add child-items to a menu-item, do this (you can use as many as you want):
if you want to force a link-direction to an item then add this:
a menu-item which contains any of the given examples could look like this:
The example provided above would output the following HTML:
which would look like this:
- {navigationName}
Attributes you could use and what they do:
Attribute | Description | Example |
---|---|---|
Id | Sets the id of the element | 'id' => 'some_id' |
class | Sets the classes of the elements | 'class' => 'class1 class2' |
Link-Attributes you could use and what they do:
Attribute | Description | Example |
---|---|---|
Id | Sets the id of the element | 'id' => 'some_id' |
Class | Sets the classes of the element | 'class' => 'class1 class2' |
Target | Sets the target-window of the element | 'target' => '_blank' |
we did not listed every link-/attribute, take a closer look at knpLabs/KnpMenu for more informations!
Credits
This bundle is inspired by Zend Framework. It has been developed by designpark.
License
The MIT License (MIT). Please see License File for more information.
All versions of middleware-navigation with dependencies
psr/container Version ^1.0
zendframework/zend-servicemanager Version ^3.4
knplabs/knp-menu Version ^2.3