plugin.tx_xxx {
setting {
storagePid = 23
}
}
I want this TYPO3 settings in utility file. Please help me.
The above method works only in controller or services class try below it will work in any PHP files in Extension.
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\Extbase\\Object\\ObjectManager');
$configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
$extbaseFrameworkConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$storagePid = $extbaseFrameworkConfiguration['plugin.']['tx_guesthouse_guesthouse.']['settings.']['storagePid'];
You can add below line in the your controller.
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
$setting = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);
$ts_config = $setting['plugin.']['tx_xxxx.']['settings.']['storagePid'];
I think it will helpful to you. You can also used this typo3 settings in the services files as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With