$inputString = "this_is_an_example"; $convertedString = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($inputString); echo $convertedString; // Outputs "ThisIsAnExample"
$someVariableName = "some_value"; $controllerClassName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase("my_extension_" . $someVariableName . "_controller"); $controllerObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($controllerClassName);In this example, the underscored format is used in constructing a controller class name based on a variable value. The constructed class name is then passed to the makeInstance function, which instantiates an object of that class. This function belongs to the "typo3/cms-core" package, which is a library that is part of the TYPO3 CMS system.