-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathforms_rendering_with_twig.yaml
64 lines (64 loc) · 3.11 KB
/
forms_rendering_with_twig.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
questions:
-
uuid: 1eebf878-8b97-6bf6-8252-99d84c92580c
question: 'How to get the value of title set in a form?'
answers:
- { value: '{{ form.title }}', correct: false }
- { value: '{{ form.vars.title }}', correct: false }
- { value: '{{ form.title.vars.value }}', correct: true }
- { value: '{{ form.vars.title.value }}', correct: false }
help: 'https://symfony.com/doc/current/form/form_customization.html#form-variables-reference'
-
uuid: 1eebf878-8b9f-6928-9ba4-99d84c92580c
question: 'From a Form instance, which method can you call to obtain a FormView instance?'
answers:
- { value: $form->getView(), correct: false }
- { value: $form->renderView(), correct: false }
- { value: $form->view(), correct: false }
- { value: $form->createView(), correct: true }
help: 'https://symfony.com/doc/current/forms.html#rendering-forms'
-
uuid: 1eebf878-8b9f-6978-8f7f-99d84c92580c
question: 'In a Twig template, which function render a form field?'
answers:
- { value: '{{ form_item(form.field) }}', correct: false }
- { value: '{{ form_render(form.field) }}', correct: false }
- { value: '{{ form_widget(form.field) }}', correct: true }
- { value: '{{ form_view(form.field) }}', correct: false }
help: 'https://symfony.com/doc/current/form/form_customization.html#form-widget-form-view-variables'
-
uuid: 1eebf878-8b9f-6e8c-8345-99d84c92580c
question: 'How do you render all the form fields in twig ?'
answers:
- { value: form_widget(form), correct: true }
- { value: form_render(form), correct: false }
- { value: form_fields(form), correct: false }
- { value: render_form(form), correct: false }
help: 'https://symfony.com/doc/current/form/form_customization.html#form-widget-form-view-variables'
-
uuid: 1eebf878-8b9f-6ed2-8f29-99d84c92580c
question: 'If you use form_widget() on a single fields, which parts are render ?'
answers:
- { value: label, correct: false }
- { value: input, correct: true }
- { value: error, correct: false }
- { value: 'label and input', correct: false }
- { value: 'error, label and input', correct: false }
help: 'https://symfony.com/doc/current/form/form_customization.html#form-rendering-functions'
-
uuid: 1eebf878-8b9f-6f22-804d-99d84c92580c
question: 'According to Symfony best practices, where you should add buttons ?'
answers:
- { value: Template, correct: true }
- { value: Form, correct: false }
- { value: Controller, correct: false }
help: 'https://symfony.com/doc/current/best_practices.html#add-form-buttons-in-templates'
-
uuid: 1eebf878-8ba4-6eb4-aa3b-99d84c92580c
question: 'How can you render a form named form in a Twig template?'
answers:
- { value: '{{ form_start(form) }}{{ form_widget(form) }}{{ form_end(form) }}', correct: true }
- { value: '{{ form(form) }}', correct: true }
- { value: '{% form(form) %}', correct: false }
- { value: '{{ render_form(form) }}', correct: false }
help: 'https://symfony.com/doc/current/book/forms.html'