There are a few settings in the ext_conf_template.txt
in my extension.
I want to check the value of one of these settings, but in typoscript
, not in PHP.
In PHP it works like this:
unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['myExt'])
How should I do this in typoscript?
Handle the configuration via Extension Manager and call
ExtensionManagementUtility::addTypoScriptConstants()
in yourext_localconf.php
to set a TypoScript constant at runtime.This way the value can be set at one location and is available both in lowlevel PHP and TypoScript setup.
I did something similar in my code snippet extension (see complete code on Github), where I just added a custom TypoScript condition:
The condition implementation is quite simple:
And the check for the actual
TYPO3_CONF_VARS
value is done inFsCodeSnippetConfigurationUtility
:Maybe that fits your needs.