Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
namespace MyBundle\Bundle\LabelBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class LabelType extends AbstractType
{
public function buildForm (FormBuilderInterface $builder, array $options)
{
$builder->add (
'name',
'text',
[
'label' => 'Label',
'required' => true,
]
);
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults ([
'data_class' => 'MyBundle\Bundle\LabelBundle\Entity\Label',
'intention' => 'label',
]);
}
/**
* Returns the name of this type.
*
* @return string The name of this type
*/
public function getName ()
{
return 'mybundle_label';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.