Situation:
I use EasyAdmin for the backend. I have an entity named Vehicle. From it, I've created Car and Bicycle.
I have another entity with a OneToMany relation linked to Vehicle. Problem is, when I click the link created by EasyAdmin, it redirects me to the admin page with the Vehicle crudId. I need it to redirect me to either to the Car or the Bicycle one, depending on the type of the Vehicle.
I've set the AssociationField like this:
public function configureFields(string $pageName): iterable
{
return [
AssociationField::new('Vehicle', 'The vehicle')->autocomplete()->setCrudController(Car::class)
]
}
Problem:
You can see that I set the crud controller to Car, but here is my problem : I need to set this dynamically, either Car or Bicycle. Is it possible to do it?
Thank you to everyone helping :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…