【发布时间】:2018-06-29 14:12:20
【问题描述】:
我正在尝试为我的项目使用 select2entity-bundle 来实现自动完成。
使用builder时,规范如下:
$builder
->add('country', Select2EntityType::class, [
'multiple' => true,
'remote_route' => 'tetranz_test_default_countryquery',
'class' => '\Tetranz\TestBundle\Entity\Country',
'primary_key' => 'id',
'text_property' => 'name',
'minimum_input_length' => 2,
'page_limit' => 10,
'allow_clear' => true,
'delay' => 250,
'cache' => true,
'cache_timeout' => 60000, // if 'cache' is true
'language' => 'en',
'placeholder' => 'Select a country',
// 'object_manager' => $objectManager, // inject a custom object / entity manager
])
应该在“remote_route”参数中指定什么? 为什么我的字段应该链接到路线?应该如何以及在哪里配置此路由?它应该与查询相关联吗?
感谢您的帮助!
【问题讨论】:
标签: php symfony bundle jquery-select2