$builder->add('name', 'text', array(
'label'=>"Intitulé*"
));
- $builder->add('parent', null, array(
- 'required' => false,
+
+ $builder->add('parent', 'choice', array(
+ 'choices' => $options['parentChoice'],
+ 'required' => true,
'label' => "Dépend de"
));
- $builder->add('description', 'text', array(
+
+ $builder->add('description', 'textarea', array(
'label'=>"Description"
));
$builder->add('status', 'choice', array(
public function getDefaultOptions(array $options)
{
return array(
- 'data_class' => 'Epnadmin\CoreBundle\Entity\Resource'
+ 'data_class' => 'Epnadmin\CoreBundle\Entity\Resource',
+ 'parentChoice' => $options['parentChoice'],
);
}
public function getName()
{
return 'epn_resource';
- }
+ }
}