wip: continue implementation
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Menu;
|
||||
|
||||
use Knp\Menu\FactoryInterface;
|
||||
use Knp\Menu\ItemInterface;
|
||||
|
||||
class MenuBuilder
|
||||
{
|
||||
public function __construct(
|
||||
private readonly FactoryInterface $factory,
|
||||
) {
|
||||
}
|
||||
|
||||
public function createMainMenu(): ItemInterface
|
||||
{
|
||||
$menu = $this->factory->createItem('root', [
|
||||
'childrenAttributes' => [
|
||||
'class' => 'menu menu--main',
|
||||
],
|
||||
]);
|
||||
|
||||
$menu->addChild('Meine Daten', [
|
||||
'route' => 'app_personal_data',
|
||||
'linkAttributes' => [
|
||||
'title' => 'Persönliche Daten',
|
||||
],
|
||||
]);
|
||||
$menu->addChild('Meine Buchungen', [
|
||||
'route' => 'app_bookings',
|
||||
'linkAttributes' => [
|
||||
'title' => 'Meine Buchungen',
|
||||
],
|
||||
'extras' => [
|
||||
'routes' => [
|
||||
'app_booking_edit',
|
||||
],
|
||||
],
|
||||
]);
|
||||
$menu->addChild('Logout', [
|
||||
'route' => 'app_logout',
|
||||
'linkAttributes' => [
|
||||
'title' => 'Logout',
|
||||
],
|
||||
]);
|
||||
|
||||
return $menu;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user