6
votes

I am new to extbase(MVC) Framework , How can we get typoscript values in our extension :

Eg : suppose if i have some typoscript values like:

plugin.tx_some-extname.somevlaueX = XXXX
plugin.tx_some-extname.somevlaueY = yyyy
plugin.tx_some-extname.somevlaueZ = zzzz

how will i get these values in a specific action of our controller .I hope this makes sense ??

2
After searching a lot i guess, I got my answer Configuration_EXTBASE . I haven't tried this, Will update this after testing the same in my extbase extension . Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK:***SOME CONFIGURARION TYPE ***Siva
Redundant effort, check my answer for common solutionbiesior

2 Answers

1
votes

In TYPO3-7.6 + the whole TypoScript for an extension can be retrieved with

$typoScript = $this->configurationManager->getConfiguration( $this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK);

where for the 1st parameter exist 3 different options:

$this->configurationManager::CONFIGURATION_TYPE_SETTINGS
$this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK
$this->configurationManager::CONFIGURATION_TYPE_FULL_TYPOSCRIPT

optional for the function $this->configurationManager->getConfiguration() the extension-key can be given as 2nd parameter and the plugin-name as 3rd parameter. So the whole command looks like this:

$typoScript = $this->configurationManager->getConfiguration( $this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK, $extensionKey,  $pluginName );

Consider that the static template has to be included in the backend-template to return the desired output.

ConfigurationManager is an instance of TYPO3\CMS\Extbase\Configuration\ConfigurationManager

12
votes

Declare values in the settings scope (in the setup field) ie:

plugin.tx_some-extname.settings {
    myXsetting = XXXX
}

So the all settings will be accesible in your plugin in $this->settings (as array) :

$valX = $this->settings['myXsetting'];