EasyAdminBundle
EasyAdminBundle copied to clipboard
All menu items get active state for same CrudController with another setQueryParameter is in the menu
I want to display a list of schools (projects) so that I can go from the menu to the list of applicants in each school. but when you click on one school, all schools are highlighted
public function configureMenuItems(): iterable
{
$projects = $this->projectRepository->findAll();
foreach ($projects as $project) {
yield MenuItem::subMenu($project->getName(), 'fa fa-users')->setSubItems([
MenuItem::linkToCrud('Applicant', 'fa-solid fa-users-line', Applicant::class)
->setQueryParameter('filters[project]',[ 'comparison' => '=', 'value' => $project->getId() ])
->setController(ApplicantCrudController::class)
,
]);
}
}
or is this the wrong approach?