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
|
<?php
namespace Snafu\HelpBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class BasicType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder->add('mon texte', 'text', array('label'=> "mon texte", 'attr' => array('title' => 'foo')));
$builder->add('email', 'email');
$builder->add('mon texte2', 'text', array('label'=> "mon texte", 'attr' => array('title' => 'bar')));
$builder->add('message', 'textarea');
}
public function getName()
{
return 'basic';
}
public function createBuilder($name, FormFactoryInterface $factory, array $options)
{
return new FormBuilder($name, $factory, new EventDispatcher(), $options['data_class']);
}
} |
Partager