如何使用extbase获取系统语言uid

如何使用extbase获取系统语言uid,extbase,typo3-9.x,Extbase,Typo3 9.x,在TYPO3 9.5中,只有$GLOBALS['TSFE']->sys\u language\u等位码可用。如何在控制器中获取数字系统语言uid?您可以使用新的上下文单例: $context=GeneralUtility::makeInstance(context::class); 返回(int)$context->getPropertyFromspect('language','id'); 这将返回数字“sys\u language\u uid”。当您查看上下文类的docblock时(请参见

在TYPO3 9.5中,只有$GLOBALS['TSFE']->sys\u language\u等位码可用。如何在控制器中获取数字系统语言uid?

您可以使用新的
上下文
单例:

$context=GeneralUtility::makeInstance(context::class);
返回(int)$context->getPropertyFromspect('language','id');
这将返回数字“sys\u language\u uid”。当您查看上下文类的docblock时(请参见
public/typo3/sysext/core/Classes/Context/Context.php
),这里还有一个可能使用的方面列表。还有一个可用的