Skip to content

Commit 01c6a4d

Browse files
author
Yann Eugoné
committed
Added support about bundle versions
1 parent d4c2c8d commit 01c6a4d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,24 @@ namespace AppBundle\Form\Type;
153153

154154
use AppBundle\Enum\GenderEnum;
155155
use AppBundle\Enum\StateEnum;
156+
use Symfony\Component\Form\AbstractType;
157+
// For Symfony >= 2.8
156158
use EnumBundle\Form\Type\EnumType;
157-
//...
158159

159-
class MemberType extends //...
160+
class MemberType extends AbstractType
160161
{
161-
//...
162-
163162
public function buildForm(FormBuilderInterface $builder, array $options)
164163
{
165164
$builder
166-
//...
165+
// For Symfony >= 2.8
167166
->add('state', EnumType::class, ['enum' => StateEnum::NAME])
168167
->add('gender', EnumType::class, ['enum' => GenderEnum::NAME])
168+
169+
// For Symfony 2.7
170+
->add('state', 'enum', ['enum' => StateEnum::NAME])
171+
->add('gender', 'enum', ['enum' => GenderEnum::NAME])
169172
;
170173
}
171-
172-
//...
173174
}
174175
```
175176

0 commit comments

Comments
 (0)