Get (all) constants with extbase extension

define property:

 

/**
* @var \TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager
*/
protected $frontendConfigurationManager;

 

method:

 

/**
* Returns the settings of the extension
*
* @return mixed
*/
public function getConstants() {
$this->frontendConfigurationManager = new \TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager;
$extConfig = $this->frontendConfigurationManager->getTypoScriptSetup();
return ($extConfig['plugin.']['tx_yourextension.']);
}

Possibilities

To return all constants from TYPO3:

 

return($extConfig);

 

To return constants of all extensions:

 

return($extConfig['plugin.']);

 

To return constants of one extension:

 

return($extConfig['plugin.']['tx_extensionname.']);