PHP code example of vienasbaitas / menu

1. Go to this page and download the library: Download vienasbaitas/menu 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/ */

    

vienasbaitas / menu example snippets


$menu = new \VienasBaitas\Menu\Menu();

$menu->option('admin', true);

$menu->item('Dashboard')->path('/dashboard')->active()->option('auth', true);
$menu->item('Settings')->path('/settings')->order(0);
$menu->item('Blog')->path('/blog')->target(\VienasBaitas\Menu\MenuItem::TARGET_BLANK);

$renderer = new \VienasBaitas\Menu\Renderers\ArrayRenderer();

$asArray = $renderer->render($menu);