-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathforms_creation.yaml
74 lines (74 loc) · 4.4 KB
/
forms_creation.yaml
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
71
72
73
74
questions:
-
uuid: 1eebf878-8b9b-6af8-a1b1-99d84c92580c
question: 'What are the methods of Symfony\Component\Form\FormTypeInterface?'
answers:
- { value: 'public function buildView(FormInterface $form, array $options);', correct: false }
- { value: 'public function getDefaultOptions(OptionsResolverInterface $resolver);', correct: false }
- { value: 'public function finishView(FormView $view, FormInterface $form, array $options);', correct: true }
- { value: 'public function configureOptions(OptionsResolverInterface $resolver);', correct: false }
- { value: 'public function getDefaultOptions(OptionsResolver $resolver);', correct: false }
- { value: 'public function finishView(FormView $view, array $options);', correct: false }
- { value: 'public function getName();', correct: false }
- { value: 'public function buildView(FormView $view, FormInterface $form, array $options);', correct: true }
- { value: 'public function getBlockPrefix();', correct: true }
- { value: 'public function buildForm(FormBuilderInterface $builder, array $options);', correct: true }
- { value: 'public function getParent();', correct: true }
- { value: 'public function buildForm(FormBuilder $builder, array $options);', correct: false }
- { value: 'public function getType();', correct: false }
- { value: 'public function getParentType();', correct: false }
- { value: 'public function configureOptions(OptionsResolver $resolver);', correct: true }
help: 'https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/Form/FormTypeInterface.php'
-
uuid: 1eebf878-8b9f-6db0-82a3-99d84c92580c
question: 'How do you set default value?'
answers:
- { value: $this->createFormBuilder($defaultEntityOrArray), correct: true }
- { value: '$this->createFormBuilder(null, $defaultEntityOrArray)', correct: false }
- { value: $this->createFormBuilder()->setDefaults($defaultEntityOrArray), correct: false }
- { value: $this->createFormBuilder()->addDefaults($defaultEntityOrArray), correct: false }
help: 'https://symfony.com/doc/current/components/form.html#setting-default-values'
-
uuid: 1eebf878-8b9f-6df6-80c3-99d84c92580c
question: 'Your Form class must extend which of the following?'
answers:
- { value: Symfony\Component\Form\FormType, correct: false }
- { value: Symfony\Component\Form\AbstractType, correct: true }
- { value: Symfony\Component\Form\AbstractFormType, correct: false }
help: 'https://symfony.com/doc/current/forms.html#creating-form-classes'
-
uuid: 1eebf878-8b9f-6e46-9327-99d84c92580c
question: 'How to add an extra field `extra` with the form ?'
answers:
- { value: "$builder->add('extra', null, ['mapped' => false])", correct: true }
- { value: "$builder->add('extra', 'hidden', ['mapped' => false])", correct: true }
- { value: "$builder->add('extra', null, ['validation' => false]", correct: false }
help: 'https://symfony.com/doc/current/forms.html#unmapped-fields'
-
uuid: 1eebf878-8ba4-60e0-b407-99d84c92580c
question: 'What is the tag to use to create a custom form field type?'
answers:
- { value: form.type_extension, correct: false }
- { value: form_type, correct: false }
- { value: form.type, correct: true }
- { value: form, correct: false }
help: 'https://symfony.com/doc/current/reference/dic_tags.html#form-type'
-
uuid: 1eebf878-8ba9-6a4a-8062-99d84c92580c
question: 'Consider the following HTML generated from a Symfony form: <form method="POST" action="/"> <input type="hidden" name="_method" value="PUT" /> </form> Which HTTP method will be present in the Symfony Request object assuming HTTP methods overriding setting is turned on?'
answers:
- { value: PATCH, correct: false }
- { value: PUT, correct: true }
- { value: GET, correct: false }
- { value: POST, correct: false }
help: 'https://symfony.com/doc/current/forms.html'
-
uuid: 1eed57ed-5466-653a-809e-97a3266a921d
question: 'What is the default translation domain for form label?'
answers:
- { value: labels, correct: false }
- { value: form, correct: true }
- { value: messages, correct: false }
- { value: forms, correct: false }
- { value: default, correct: false }
help: 'https://symfony.com/doc/current/reference/forms/types/form.html#translation-domain'