Use a form type for entry

This commit is contained in:
Jeremy
2015-02-16 21:31:42 +01:00
parent 78cedc2262
commit 7781faa0b0
3 changed files with 32 additions and 6 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class EntryType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('url', 'url')
->add('save', 'submit')
;
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
));
}
public function getName()
{
return 'entry';
}
}