PHP code example of depa / middleware-navigation

1. Go to this page and download the library: Download depa/middleware-navigation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

depa / middleware-navigation example snippets


     $app->pipe(depa\NavigationMiddleware\Middleware\NavigationMiddleware::class);

'{navigation_Name}' => [
    'route' => '{route_name}', //route-name which is set in routes.php
]

'{navigation_Name}' => [
    'attributes' => [...], //possibilitys in attributes-table described (at the bottom of the doc)
]

'{navigation_Name}' => [
    'linkAttributes' => [...], //possibilitys in link-attributes-table described (at the bottom of the doc)
]

'{navigation_Name}' => [
    'childs' => [...], //build the same as a normal menu-item
]

'{navigation_Name}' => [
    'uri' => '{https://www.designpark.de}',
]

'{navigation_Name}' => [
    'route' => '{route_name}',
    'uri' => '{https://www.designpark.de}',
    'attributes' => [
        'id' => '{some_id}',
        'class' => ['{class1} {class2}'],
    ],
    'linkAttributes' => [
        'id' => '{some_id}',
        'class' => '{class_1} {class2}',
    ],
    'childs' => [
        '{childNavigation_Name}' => [
            'route' => '{route_name}',
            'uri' => '{https://www.designpark.de}',
            'attributes' => [],
            'linkAttributes' => [],
            'childs' => [],
        ]
    ]
]