Read "LocalConfiguration" in TYPO3 6.1 - ViewHelper

327 views Asked by At

i want to read some data from the LocalConfiguration. I don't found a way for fluid and for an ViewHelper.

I hope everyone can help me. Thanks! :)

2

There are 2 answers

0
Jost On BEST ANSWER

From experience I have learned that you should NOT use the class TYPO3\CMS\Core\Configuration\ConfigurationManager. It is considered internal and may not return the actual configuration (disregarding settings done in AdditionalConfiguration.php). See for example the discussion here.

Instead, access the data using the variable $GLOBALS['TYPO3_CONF_VARS'], e.g. use

echo $GLOBALS['TYPO3_CONF_VARS']['DB']['username'].
1
theowi On

Ok - i have found a solution to read the LocalConfiguration File from TYPO3 with an ViewHelper.

$localConf = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');

//Get Debug:
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($localConf->getLocalConfiguration());

Now you have the complete LocalConf. Array.