Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

Multiples form request Symfony 4

$
0
0

I want to build form to perform multiples request. Here is an example of what i want to do enter image description here

In this case SQL request should be something like this :

SELECT * FROM DB WHERE city = city1 or city = city2 or pet = pet2 or pet = pet3 or food = food1

I tried to do it with symfony with no success because "symfony except string not array"

   class CoreSearchType extends AbstractType
    {
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('city' , ChoiceType::class, [
            'choices' =>array('France' => $this->getChoicesCities()),
                'label' => false,'required' => true,'placeholder'=>'Choose','multiple' => true])

But i dont know what how to do it. If someone can help me finding the way to do it ... Thanks !


Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>