PHP code example of erikgall / menus

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

    

erikgall / menus example snippets


$menu = $menus->build('siteMenu', function ($m) {

      $m->add('MAIN NAVIGATION', ['class' => 'header']);

      $dashboard = $m->add('Dashboard', ['url' => '#', 'class' => 'treeview']);

      $dashboard->link->wrap('span')
                      ->fa('dashboard')
                      ->iconLeft();

      $dashboard->add('Settings', ['url' => route('admin.dashboard')])->link->wrap('span')
                                                                            ->fa('circle-o');

      $page = $m->add('Pages', ['url' => route('admin.page.index')]);

      $page->link->wrap('span')
                 ->fa('newspaper-o');

      return $m;
    });