Closed fmronan closed 8 years ago
Hello !
In your extended bundle, simply create a "Type" directory, and for example create a new EventFormType class that extends the root form type.
For example, in my case I had to extend the event form type, this is my class :
<?php
namespace Tag\Bundle\CalendarBundle\Form\Type;
use BladeTester\CalendarBundle\Form\Type\EventFormType as BaseType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\ORM\EntityRepository;
class EventFormType extends BaseType {
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title', 'text', array(
'label' => 'bladetester_calendar.label.event.title',
))
/* .. Your fields .. */
;
}
/**
* {@inheritdoc}
*/
public function getName()
{
return 'event';
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => $this->dataClass
));
}
}
Don't forget to rename the namespace with your correct one.
Hope this helps you =)
Thanks That's a great bundle. I can manage date with datetime picker, I can manage many users. and I change Showmini, now it work alone with jquery like fullcalendar, great.
Can you help me? Everythings work fine with your bundle, but I don't find, how I can extends Formtype in my bundle? Can you explain me that, please? Sorry for my english