1. Go to this page and download the library: Download braunstetter/menu-bundle 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/ */
braunstetter / menu-bundle example snippets
namespace App\Menu;
use Braunstetter\MenuBundle\Contracts\MenuInterface;
use Braunstetter\MenuBundle\Events\MenuEvent;
use Braunstetter\MenuBundle\Factory\MenuItem;
use Traversable;
class MainMenu implements MenuInterface
{
public function define(): Traversable
{
yield MenuItem::linkToRoute('System', 'route_to_my_system', [], 'images/svg/system.svg')->setChildren(function () {
yield MenuItem::linkToUrl('Section', 'https://my-site.com', MenuItem::TARGET_BLANK, 'images/svg/thunder.svg')->setChildren(function () {
yield MenuItem::linkToRoute('Site', 'site', [], 'images/svg/align_justify.svg');
yield MenuItem::linkToRoute('Dashboard', 'cp_dashboard');
});
});
}
}