如何在存储库中设置 flexform

How flexform settings in the repository

我想访问存储库中的弹性设置。

this-> settings

没用。

在存储库中向您的方法添加更多参数,并使用此参数分配设置。 如果您有多个需要这些设置的方法,请将 ConfigurationManager 注入 Repository 并使用 getConfiguration() 检索设置。请参阅 AbstractController.php 中的示例。

您可以在存储库文件中获取 flexform 设置值,如下所示。

$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);
$settings = $extbaseFrameworkConfiguration['plugin.']['tx_extension?key_pluginname.']['settings'];