【问题标题】:select2entity-bundle send second parameter with ajaxselect2entity-bundle 使用 ajax 发送第二个参数
【发布时间】:2016-10-29 11:33:28
【问题描述】:

我正在使用tetranz/select2entity-bundle,我想通过 ajax 发送另一个参数以在查询中使用它。

$builder->add('client', Select2EntityType::class, array(
                'multiple' => false,
                'remote_route' => 'clientquery',
                'class' => 'ProjetsBundle\Entity\Client',
                'primary_key' => 'id',
                'placeholder' => 'Sélectionnez un client',
                'language' => 'fr',
                'page_limit' => 50,
            ))

这可能吗?

【问题讨论】:

    标签: ajax symfony select2


    【解决方案1】:

    是的,这是可能的,并且可以使用“remote_params”选项进行圆顶

     $builder->add('client', Select2EntityType::class, array(
                    'multiple' => false,
                    'remote_route' => 'clientquery',
                    'class' => 'ProjetsBundle\Entity\Client',
                    'primary_key' => 'id',
                    'placeholder' => 'Sélectionnez un client',
                    'language' => 'fr',
                    'page_limit' => 50,
                    'remote_params' => array('secondparameter'=>'value',
                                     'thirdparameter'=>'value')
    
                ))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-08
      • 2011-02-23
      • 1970-01-01
      • 1970-01-01
      • 2016-08-29
      • 2018-01-10
      • 1970-01-01
      相关资源
      最近更新 更多