Since TYPO3 itself does not support custom feature toggles in the backend, I wanted to build my own implementation for this.
I looked at the ConfigurationManager.php and it says in the comment at the top:
‘This class is intended for internal core use ONLY.
- Extensions should usually use the resulting $GLOBALS[‘TYPO3_CONF_VARS’] array,
- do not try to modify settings in LocalConfiguration.php with an extension.’
But if I now try to edit the globals in my action:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['features'][$feature] = !$GLOBALS['TYPO3_CONF_VARS']['SYS']['features'][$feature];
The value only changes for a short time and after I reload the page, the value is reset again.
Am I missing something or is there another value I could go for?
2
Answers
Edit Your typoscript with this
yourfile.php
I made my own feature toggle in this way.
An on/off switch as an extension configuration in ext_conf_template.txt
Save it, ext_localconf.php
Use it in controller
In templates