本文介绍了如何在实用程序文件中获取TYPO3设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

plugin.tx_xxx {
    setting {
        storagePid = 23
    } 
}

我想要此TYPO3设置在实用程序文件中.请帮助我.

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

推荐答案

上述方法仅适用于控制器或服务类,请尝试在下面的方法中将其用于扩展程序中的任何PHP文件.

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'];

这篇关于如何在实用程序文件中获取TYPO3设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 14:56