deblan.tv/src/Deblan/Bundle/BlogBundle/Form/Type/CommentFilterType.php
2015-03-02 21:57:49 +01:00

79 lines
1.9 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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',
)
)
);
}
}