Architecture and request · Question 4 of 12
Which information does the TYPO3 Context API provide through its aspects?
3 answers are correct. Easy
Show answer
Answer
- A Date and time of the current request
- B Whether a frontend or backend user is logged in, and which one
- E The current language including its fallback settings
Explanation
The Context API (TYPO3\) collects information about the current request in so-called aspects, for example date, language, frontend.user, backend.user, visibility and workspace. You obtain the context via dependency injection and query individual values, for instance with $context->getPropertyFromAspect('frontend.user', 'isLoggedIn'). This is cleaner than looking into global variables and makes code testable, because the context can be prepared specifically for a test. Session contents and extension settings are not part of it; the latter are read via ExtensionConfiguration.