-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathCreateVehicleForm.php
More file actions
48 lines (42 loc) · 1.06 KB
/
Copy pathCreateVehicleForm.php
File metadata and controls
48 lines (42 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace Craue\FormFlowBundle\Tests\IntegrationTestBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
/**
* @author Christian Raue <christian.raue@gmail.com>
* @copyright 2011-2015 Christian Raue
* @license http://opensource.org/licenses/mit-license.php MIT License
*/
class CreateVehicleForm extends AbstractType {
/**
* {@inheritDoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options) {
switch ($options['flow_step']) {
case 1:
$choices = array(2, 4);
$builder->add('numberOfWheels', 'choice', array(
'choices' => array_combine($choices, $choices),
'empty_value' => '',
));
break;
case 2:
$choices = array(
'electric',
'gas',
'naturalGas',
);
$builder->add('engine', 'choice', array(
'choices' => array_combine($choices, $choices),
'empty_value' => '',
));
break;
}
}
/**
* {@inheritDoc}
*/
public function getName() {
return 'createVehicle';
}
}