Dynamic ChoiceType (select2 + AJAX)
问题 I need a form field to choose from thousands of entities, so a dynamic choice system like select2 (with AJAX) is perfectly suited. My AJAX endpoint works fine, but the custom form type does not work: class Select2AjaxDataCategoryType extends AbstractType { /** * @var EntityManagerInterface */ private $entityManager; /** * @var RouterInterface */ private $router; public function __construct(EntityManagerInterface $entityManager, RouterInterface $router) { $this->entityManager = $entityManager;