You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
since using Pretty URLs, I have issue with the dashboards.
config/routes/easyadmin.yaml:
easyadmin:
resource: .
type: easyadmin.routes
I create 2 diffrent dashboards.
admin:
<?php
namespace App\Controller\Admin;
use App\Entity\Order;
use App\Entity\User;
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class AdminDashboardController extends AbstractDashboardController
{
#[Route('/admin', name: 'admin')]
public function index(): Response
{
return $this->render('admin/index.html.twig');
}
public function configureDashboard(): Dashboard
{
return Dashboard::new()
->setTitle('Demo');
}
public function configureMenuItems(): iterable
{
yield MenuItem::linkToDashboard('Dashboard', 'fa6-solid:house');
yield MenuItem::linkToCrud('Users', 'fas fa-list', User::class);
yield MenuItem::linkToCrud('Orders', 'fas fa-list', Order::class);
}
}
aff:
<?php
namespace App\Controller\Aff;
use App\Entity\User;
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class AffDashboardController extends AbstractDashboardController
{
#[Route('/aff', name: 'aff')]
public function index(): Response
{
return $this->render('admin/index.html.twig');
}
public function configureDashboard(): Dashboard
{
return Dashboard::new()
->setTitle('Demo');
}
public function configureMenuItems(): iterable
{
yield MenuItem::linkToDashboard('Dashboard', 'fa6-solid:house');
yield MenuItem::linkToCrud('Users', 'fas fa-list', User::class);
}
}
Hi.
since using Pretty URLs, I have issue with the dashboards.
config/routes/easyadmin.yaml:
I create 2 diffrent dashboards.
admin:
aff:
when I go to https://127.0.0.1:8000/aff it shows the current aff dashboard. which is ok!
but when I hit for example to Users.
it's goes to admin dashboard with all the links
I found that the links on the menu always is "/admin". but my aff dashboard is '/aff'
and after I click "Users" it's change to AdminDashboard, with all the urls and menus.
adding:
#[AdminDashboard]
fix the urls issue.
but the major problem, when I click one of the Dashboard item, it will show after that the 'admin' menu
The text was updated successfully, but these errors were encountered: