tetranz / select2entity-bundle

A Symfony2 bundle that integrates Select2 as a drop-in replacement for a standard entity field on a Symfony form.
MIT License
219 stars 110 forks source link

How to set header X-AUTH-USER info from bundle? #178

Open lukasmat opened 3 years ago

lukasmat commented 3 years ago

How to set header X-AUTH-USER info from bundle?

        ->add('test', Select2EntityType::class, [
            'multiple' => false,
            'remote_route' => 'api_users_get_collection',
            'remote_params' => [
                'headers' => [
                    'X-AUTH-USER' => 'test',
                    'X-Auth-Token' => 'test',
                ]
            ], // static route parameters for request->query
            'class' => Test::class,
            '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 test',
        ])