Typo3 类型3 Extbase storagePid
我需要获得实际的“常规记录存储页面id”。我找到了下面的snipplet,但是即使在页面上设置了storagePid,变量也是空的Typo3 类型3 Extbase storagePid,typo3,extbase,Typo3,Extbase,我需要获得实际的“常规记录存储页面id”。我找到了下面的snipplet,但是即使在页面上设置了storagePid,变量也是空的 $config = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); var_dump($config['persistence']['st
$config = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
var_dump($config['persistence']['storagePid']);
任何帮助都将不胜感激我不太清楚,你想得到什么。您提供的代码片段可以毫无问题地获取在常量中为扩展设置的storagePid,与
setup.txt
中的代码相同:
plugin.tx_yourext {
persistence {
storagePid = {$plugin.tx_yourext.persistence.storagePid}
}
}
如果使用提供的代码片段获取storagePid时遇到问题,还可以修改setup.txt
,并确保该值也将传播到设置
范围:
plugin.tx_yourext {
persistence {
storagePid = {$plugin.tx_yourext.persistence.storagePid}
}
settings {
storagePid = {$plugin.tx_yourext.persistence.storagePid}
}
}
然后,在控制器中,您可以使用更简单的代码捕获它:
$myStoragePid = $this->settings['storagePid'];
如果它对您不起作用,这意味着您没有在文本的常量中设置正确的值,和/或没有清除BE中的缓存
顺便说一句:如果你说得更具体些,我可能会给你更好的答案