79 lines
1.9 KiB
PHP
79 lines
1.9 KiB
PHP
|
<?php
|
|||
|
|
|||
|
namespace Deblan\Bundle\BlogBundle\Form\Type;
|
|||
|
|
|||
|
use Propel\PropelBundle\Form\BaseAbstractType;
|
|||
|
use Symfony\Component\Form\FormBuilderInterface;
|
|||
|
|
|||
|
class CommentFilterType extends BaseAbstractType
|
|||
|
{
|
|||
|
protected $options = array(
|
|||
|
'data_class' => 'Deblan\Bundle\BlogBundle\Model\Comment',
|
|||
|
'name' => 'comment',
|
|||
|
'csrf_protection' => false,
|
|||
|
);
|
|||
|
|
|||
|
/**
|
|||
|
* {@inheritdoc}
|
|||
|
*/
|
|||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|||
|
{
|
|||
|
$builder->add(
|
|||
|
'PostId',
|
|||
|
'model',
|
|||
|
array(
|
|||
|
'label' => 'Article',
|
|||
|
'class' => 'Deblan\Bundle\BlogBundle\Model\Post',
|
|||
|
'query' => \Deblan\Bundle\BlogBundle\Model\PostQuery::create()->orderByTitle(),
|
|||
|
'multiple' => false,
|
|||
|
'expanded' => false,
|
|||
|
'required' => false,
|
|||
|
)
|
|||
|
);
|
|||
|
|
|||
|
$builder->add(
|
|||
|
'Author',
|
|||
|
'text',
|
|||
|
array(
|
|||
|
'label' => 'Auteur',
|
|||
|
'attr' => array('class' => 'form-control'),
|
|||
|
'required' => false,
|
|||
|
)
|
|||
|
);
|
|||
|
|
|||
|
$builder->add(
|
|||
|
'Website',
|
|||
|
'url',
|
|||
|
array(
|
|||
|
'label' => 'Site web',
|
|||
|
'attr' => array('class' => 'form-control'),
|
|||
|
'required' => false,
|
|||
|
)
|
|||
|
);
|
|||
|
|
|||
|
$builder->add(
|
|||
|
'Email',
|
|||
|
'email',
|
|||
|
array(
|
|||
|
'label' => 'Email',
|
|||
|
'attr' => array('class' => 'form-control'),
|
|||
|
'required' => false,
|
|||
|
)
|
|||
|
);
|
|||
|
|
|||
|
$builder->add(
|
|||
|
'Active',
|
|||
|
'choice',
|
|||
|
array(
|
|||
|
'label' => 'En ligne',
|
|||
|
'required' => false,
|
|||
|
'choices' => array(
|
|||
|
'bool.both' => 'Anyway',
|
|||
|
'bool.true' => 'True',
|
|||
|
'bool.false' => 'False',
|
|||
|
)
|
|||
|
)
|
|||
|
);
|
|||
|
}
|
|||
|
}
|