简体   繁体   中英

TYPO3 Extbase storagePid

I need to get the actual "general record storage page id". I found the following snipplet but the variable is empty even though the storagePid is set on the page.

$config = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
var_dump($config['persistence']['storagePid']);

Any help would be appreciated

I'm not quite sure, what are you trying to get. Snippet you provided gets without problems the storagePid set in constants for your extension, the same as this code from setup.txt :

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

if you have problems with getting your storagePid with provided snippet also can modify your setup.txt and make sure that the value will be also propagated into settings scope:

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

then in your controller you can catch it with simpler code:

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

if it will not work for you that means, you didn't set proper value in Constants for YourExt and/or didn't cleared the caches in the BE.

BTW: Maybe if you'll be more specific I could send better answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM