src/EventListener/MenuBuilderListener.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\EventListener;
  3. use Sonata\AdminBundle\Event\ConfigureMenuEvent;
  4. final class MenuBuilderListener
  5. {
  6.     public function addMenuItems(ConfigureMenuEvent $event): void
  7.     {
  8.         $menu $event->getMenu()->addChild('monitoring')->setExtras(['icon' => 'fas fa-folder'])->setLabel('Monitor');
  9.         
  10.         $live $menu->addChild('monitoring_live', [
  11.                 'label' => 'Live',
  12.                 'route' => 'monitoring_live',
  13.             ])->setExtras([
  14.                 'icon' => 'fa fa-bar-chart'// html is also supported
  15.                 'class' => "treeview",
  16.             ]);
  17.         $availability $menu->addChild('monitoring_reports_availability', [
  18.                 'label' => 'Availability',
  19.                 'route' => 'monitoring_reports_availability',
  20.             ])->setExtras([
  21.                 'icon' => 'fa fa-bar-chart'// html is also supported
  22.             ]);
  23.         $status $menu->addChild('monitoring_reports_statuschange', [
  24.                 'label' => 'Status Report',
  25.                 'route' => 'monitoring_reports_statuschange',
  26.             ])->setExtras([
  27.                 'icon' => 'fa fa-bar-chart'// html is also supported
  28.             ]);
  29.     }
  30. }