Skip to content
Advertisement

How to get TYPO3 settings in the utility files?

plugin.tx_xxx {
    setting {
        storagePid = 23
    } 
}

I want this TYPO3 settings in utility file. Please help me.

Advertisement

Answer

The above method works only in controller or services class try below it will work in any PHP files in Extension.

$objectManager = TYPO3CMSCoreUtilityGeneralUtility::makeInstance('TYPO3\CMSExtbase\Object\ObjectManager');
$configurationManager = $objectManager->get('TYPO3\CMS\Extbase\Configuration\ConfigurationManager');
$extbaseFrameworkConfiguration = $configurationManager->getConfiguration(TYPO3CMSExtbaseConfigurationConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$storagePid = $extbaseFrameworkConfiguration['plugin.']['tx_guesthouse_guesthouse.']['settings.']['storagePid'];
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement