6

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 ??

Siva
  • 481
  • 7
  • 26
  • After searching a lot i guess, I got my answer [Configuration_EXTBASE](http://forge.typo3.org/projects/typo3v4-mvc/wiki/ConfigurationManager_rework) . 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 Jan 07 '13 at 05:47
  • Redundant effort, check my answer for common solution – biesior Jan 07 '13 at 05:50

2 Answers2

12

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'];
biesior
  • 55,576
  • 10
  • 125
  • 182
1

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

David
  • 5,882
  • 3
  • 33
  • 44