Symfony 3.x form types demo from DevmachineFormBundle. You can access Symfony 2.x demo here.

Convert array model into string. Ideal for editing simple enums.

$langs = ['PHP', 'Ruby', 'Python', 'Go', 'Java'];

$form = $this->createNamedBuilder('flat')
    ->add('langs', FlatChoiceType::class, [
        'label'     => 'Programming languages',
        'separator' => ', ', // default
    ])
    ->getForm()
    ->setData(['langs' => $langs])
;

Easy way to build connected choices.
When dealing with entities use group_by option for child choices.

$countries = ['Germany', 'Japan'];

$manufacturers = [
    'Germany'  => ['BMW', 'Audi', 'Mercedes'],
    'Japan'    => ['Honda', 'Toyota', 'Nissan'],
];

$models = [
    'BMW'      => ['X3', 'X5', 'X6'],   'Audi'   => ['A1', 'A6', 'A6'],
    'Mercedes' => ['Vito', 'Sprinter'], 'Honda'  => ['Accord', 'Civic'],
    'Toyota'   => ['Avensis', 'Camry'], 'Nissan' => ['Versa', 'X-trail'],
];

$combine = function (array $items) { return array_combine($items, $items); };

$form = $this->createNamedBuilder('child')
    ->add('country', ChoiceType::class, [
        'choices'     => $combine($countries),
        'required'    => false,
        'placeholder' => 'Select country',
    ])
    ->add('manufacturer', ChildChoiceType::class, [
        'parent'      => 'country',
        'required'    => false,
        'placeholder' => 'Select manufacturer',
        'choices'     => array_map($combine, $manufacturers),
    ])
    ->add('model', ChildChoiceType::class, [
        'parent'      => 'manufacturer',
        'required'    => false,
        'placeholder' => 'Select model',
        'choices'     => array_map($combine, $models),
        'select2'     => true, // Style with select2
    ])
    ->getForm()
;