Q
Q
Qixing2015-01-30 02:08:25
symfony
Qixing, 2015-01-30 02:08:25

How to reset select with reset in Symfony?

I'm trying to organize a form reset of all values. For

->add(
                'category',
                'entity',
                array(
                    'class' => 'Category',
                    'property' => 'name',
                    'empty_value' => '-- Все --',
                    'multiple' => true,
                    'expanded' => true,
                    'required' => false,
                   
                )
            )

Everything is reset.
But what about the select?
->add(
                'maker',
                'entity',
                array(
                    'class' => 'Maker',
                    'property' => 'name',
                    'required' => false,
                    'data' => null,
                    'empty_value' => '-- Все --',
                )
            )

Haven't tried it yet. And empty_data, preferred_choices doesn't help anything.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kapai69, 2015-01-30
@kapai69

->add('test', null, array(
                'empty_value'       => '-- Все --',
                'empty_data'        => null,

            ));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question