簡體   English   中英

TYPO3 Extbase storagePid

[英]TYPO3 Extbase storagePid

我需要獲得實際的“常規記錄存儲頁面ID”。 我發現了下面的snipplet,但即使在頁面上設置了storagePid,變量也是空的。

$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並確保該值也會傳播到settings范圍:

plugin.tx_yourext {
    persistence {
        storagePid = {$plugin.tx_yourext.persistence.storagePid}
    }
    settings {
        storagePid = {$plugin.tx_yourext.persistence.storagePid}
    }
}

然后在你的控制器中你可以用更簡單的代碼捕獲它:

$myStoragePid = $this->settings['storagePid'];

如果它不適合你,那意味着你沒有在Constants for YourExt中設置適當的值和/或沒有清除BE中的緩存。

順便說一句:也許如果你更具體,我可以發出更好的答案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM