1. Go to this page and download the library: Download nethead/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/ */
nethead / menu example snippets
use Nethead\Menu\Factories\MenusFactory;
MenusFactory::make('main-menu');
use Nethead\Menu\Activators\BasicUrlActivator;
use Nethead\Menu\Renderers\MarkupRenderer;
use Nethead\Menu\Repository;
use Nethead\Menu\Menu;
$menu = new Menu('sidebar', new BasicUrlActivator(), new MarkupRenderer());
Repository::set($menu);
use Nethead\Menu\Repository;
// one created with MenusFactory
$mainMenu = Repository::get('main-menu');
// one created manually and registered
$sidebarMenu = Repository::get('sidebar');
use Nethead\Menu\Activators\BasicUrlActivator;
use Nethead\Menu\Renderers\MarkupRenderer;
use Nethead\Menu\Items\Internal;
use Nethead\Menu\Menu;
$menu = new Menu('sidebar', new BasicUrlActivator(), new MarkupRenderer());
$item = new Internal(['The text for the link'], '/one/of/your/pages', $menu);
$menu->setItem($item);