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
| <?php
namespace SB\PrestaBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ForfaitType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title', 'text')
->add('comment', 'textarea')
->add('prix', 'integer')
->add('afficher','checkbox', array('required' => false))
->add('prestacateg', 'entity', array(
'class' => 'SBPrestaBundle:Prestacateg',
'property' => 'title', 'expanded' => false,
'multiple' => false, 'label' => false))
->add('quttprestaforfait', 'collection', array(
'type' => new QuttPrestaForfaitType(),
'label' => 'Titre',
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false,))
;
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'SB\PrestaBundle\Entity\Forfait'
));
}
public function getName()
{
return 'forfaittype';
}
} |
Partager