-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathIssue64Form.php
More file actions
53 lines (47 loc) · 1.24 KB
/
Copy pathIssue64Form.php
File metadata and controls
53 lines (47 loc) · 1.24 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
49
50
51
52
53
<?php
namespace Craue\FormFlowBundle\Tests\IntegrationTestBundle\Form;
use Craue\FormFlowBundle\Tests\IntegrationTestBundle\Entity\Issue64SubData;
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 Issue64Form extends AbstractType {
/**
* {@inheritDoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options) {
switch ($options['flow_step']) {
case 1:
$subForm = $builder->create('sub', 'form', array(
'data_class' => get_class(new Issue64SubData()),
));
$subForm->add('prop1', 'text', array(
'required' => true,
));
$builder->add($subForm);
break;
case 2:
case 3:
$subForm = $builder->create('sub', 'form', array(
'data_class' => get_class(new Issue64SubData()),
));
$subForm->add('prop2', 'text', array(
'required' => true,
));
$builder->add($subForm);
break;
case 4:
// nothing
break;
}
}
/**
* {@inheritDoc}
*/
public function getName() {
return 'issue64';
}
}