forked from egeloen/symfony-standard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestionType
70 lines (59 loc) · 1.94 KB
/
QuestionType
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
namespace General\GeneralBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class QuestionType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title', 'text', array (
'label' => 'Story title',
'attr' => array (
'placeholder' => 'i.e: road trip across France',
)
) )
/*
* $builder->add('fromDate','datetime',array( 'input' => 'datetime', 'widget' => 'single_text', 'format' => 'dd-MM-yyyy', 'attr' => array('class' => 'date') )); $builder->add('toDate','datetime',array( 'input' => 'datetime', 'widget' => 'single_text', 'format' => 'dd-MM-yyyy', 'attr' => array('class' => 'date') ));
*/
->add ( 'description', 'ckeditor', array (
'label' => 'Your Story',
'attr' => array (
'placeholder' => 'Minimum 1000 characters ',
) ,
'config' => array(
'filebrowserUploadRoute' => 'GeneralGeneralBundle_account_profile_question_photo_upload',
'filebrowserUploadRouteParameters' => array('user_id' => '10', 'responseType' => 'json'),
'filebrowserUploadRouteAbsolute' => true,
),
) )
->add ( 'tags', 'text', array (
'label' => 'Related tags',
'attr' => array (
'placeholder' => 'i.e: road trip, city tour, argentina',
'class' => 'input-medium search-query'
)
) );
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'General\GeneralBundle\Entity\Question'
));
}
/**
* @return string
*/
public function getName()
{
return 'general_question';
}
}