// Get the current application context $context = \TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext(); // Output the application context echo $context->isDevelopment() ? 'Development' : 'Live';
// Get the current application context $context = \TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext(); // Check if the context is a frontend context if ($context->isFrontend()) { // Display a message for frontend users echo 'Welcome to the frontend!'; } else if ($context->isBackend()) { // Display a message for backend users echo 'Welcome to the backend!'; }This example gets the current application context and checks if it is a frontend context or backend context. Depending on the context, it displays a different message to the user. Package Library: TYPO3\CMS\Core\Utility\GeneralUtility.