-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgenerate_url_parameters.yaml
66 lines (66 loc) · 3.5 KB
/
generate_url_parameters.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
questions:
-
uuid: 1eebf878-8b99-61f4-bf74-99d84c92580c
question: 'How is it possible to generate absolute URLs from the Console?'
answers:
- { value: 'The host is automatically known by Symfony, there is no need to specify it in CLI.', correct: false }
- { value: 'By specifying the host parameter in the Twig function url().', correct: false }
- { value: "By running $this->getContainer()->get('router')->getContext()->setHost('example.org');", correct: true }
- { value: 'By overloading the parameter router.request_context.host in the configuration.', correct: true }
help: 'https://symfony.com/doc/current/routing.html#generating-urls-in-commands'
-
uuid: 1eebf878-8b99-635c-8475-99d84c92580c
question: 'What is returned by Route::compile()?'
answers:
- { value: 'A CompiledRoute instance', correct: true }
- { value: 'A boolean', correct: false }
- { value: Nothing, correct: false }
- { value: 'A RouteToCompile instance', correct: false }
- { value: 'A RouteCompiled instance', correct: false }
help: 'https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Routing/Route.php#L402'
-
uuid: 1eebf878-8b9a-691e-8fde-99d84c92580c
question: 'Which exception is thrown when a Route defined with /page/{foo}/{foo} cannot be compiled?'
answers:
- { value: LogicException, correct: true }
- { value: RouteCompilationException, correct: false }
- { value: InvalidRouteCompilationContextException, correct: false }
- { value: InvalidArgumentException, correct: false }
- { value: RuntimeException, correct: false }
help: 'https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Routing/RouteCompiler.php#L43'
-
uuid: 1eebf878-8ba0-6fc6-8cb0-99d84c92580c
question: 'What variable can be used as controller argument to get the name of the route name?'
answers:
- { value: $_route, correct: true }
- { value: $_controller, correct: false }
- { value: $_method, correct: false }
- { value: $_action, correct: false }
help: 'https://symfony.com/doc/current/routing.html#getting-the-route-name-and-parameters'
-
uuid: 1eebf878-8ba1-605c-9981-99d84c92580c
question: 'Which special routing parameters are available in Symfony:'
answers:
- { value: _controller, correct: true }
- { value: _format, correct: true }
- { value: _fragment, correct: true }
- { value: _locale, correct: true }
- { value: _route, correct: false }
help: 'https://symfony.com/doc/current/routing.html#special-parameters'
-
uuid: 1eebf878-8ba1-60a2-996e-99d84c92580c
question: 'How to generate absolute URL for a given route in controller ?'
answers:
- { value: 'By using UrlGeneratorInterface::ABSOLUTE_URL as third parameter for generateUrl', correct: true }
- { value: 'generateUrl generate absolute URL by default', correct: false }
- { value: $this->generateAbsoluteUrl(), correct: false }
help: 'https://symfony.com/doc/current/routing.html#generating-urls-in-controllers'
-
uuid: 1eebf878-8ba8-651e-beaf-99d84c92580c
question: 'Which class permit to generate Url in command, service and to check that a route exist ?'
answers:
- { value: PathGeneratorInterface, correct: false }
- { value: UrlGenerator, correct: false }
- { value: UrlGeneratorInterface, correct: true }
- { value: PathGenerator, correct: false }
help: 'https://symfony.com/doc/6.4/routing.html#generating-urls-in-services'