Symfony2 Multiple在表单生成器上选择默认值

This has been boggling my mind for hours now, I am using Symfony2's form builder!

->add('technicians', 'choice', array(
                'choices'   => array(
                    1 => 'Test'
                ),
                'multiple'  => true,
                'data' => array(
                    1 => true
                )
            ))

Image below:

http://i.stack.imgur.com/aUi7H.png

But when I use Strings as keys in the array, it magically stops working.

Like so:

->add('technicians', 'choice', array(
                'choices'   => array(
                    'example' => 'Example'
                ),
                'multiple'  => true,
                'data' => array(
                    'example' => true
                )
            ))

http://i.stack.imgur.com/nB1pi.png

It works with:

 ->add('technicians', 'choice', array(
            'choices'   => array(
                  'example' => 'Example'
                ),
             'multiple'  => true,
             'data' => array(
                   'example' => 'example'
              ),
       ))

The value for data should match the key of the choices array.

true == 1, that's why your first example was working.