-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathglobal_variables.yaml
49 lines (49 loc) · 2.41 KB
/
global_variables.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
questions:
-
uuid: 1eebf878-8b98-6862-a729-99d84c92580c
question: 'When twig is used as a standalone library, which global variables are always available in templates?'
answers:
- { value: _context, correct: true }
- { value: app, correct: false }
- { value: _self, correct: true }
- { value: _charset, correct: true }
help: 'https://twig.symfony.com/doc/3.x/templates.html#global-variables'
-
uuid: 1eebf878-8ba5-6a30-ac9b-99d84c92580c
question: 'Will this code permit to get the {{ ga_tracking }} in every twig files ? twig.globals.ga_tracking: "UA-xxxxx-x"'
answers:
- { value: 'No', correct: false }
- { value: 'Yes', correct: true }
help: 'https://symfony.com/doc/current/templates.html#global-variables'
-
uuid: 1eebf878-8ba5-6a76-b902-99d84c92580c
question: "What's the correct way to declare the global variable uuid to get {{ uuid.generate }} in any twig files ?"
answers:
- { value: 'twig.globals.uuid: "@App\Generator\UuidGenerator"', correct: true }
- { value: 'twig.globals.uuid: "App\Generator\UuidGenerator"', correct: false }
- { value: 'twig.globals.uuid: "#App\Generator\UuidGenerator"', correct: false }
- { value: 'twig.uuid: "App\\Generator\\UuidGenerator"', correct: false }
help: 'https://symfony.com/doc/current/templates.html#global-variables'
-
uuid: 1eebf878-8ba5-6ac6-b2a2-99d84c92580c
question: 'What are the methods available on the global variable app in twig ?'
answers:
- { value: app.token, correct: true }
- { value: app.current_route_parameters, correct: true }
- { value: app.locale, correct: true }
- { value: app.enabled_locales, correct: true }
- { value: app.current_route, correct: true }
- { value: app.debug, correct: true }
- { value: app.environment, correct: true }
- { value: app.flashes, correct: true }
- { value: app.session, correct: true }
- { value: app.request, correct: true }
- { value: app.user, correct: true }
help: 'https://symfony.com/doc/current/templates.html#the-app-global-variable'
-
uuid: 1eebf878-8ba5-6b0c-88ef-99d84c92580c
question: 'What is default value of app.debug in a twig file ?'
answers:
- { value: 'true if in debug mode', correct: true }
- { value: 'false', correct: false }
help: 'https://symfony.com/doc/current/templates.html#the-app-global-variable'