0
votes

How can I set TS settings directly from my Extbase (6.2)'s controller?

So here:

/**
 * action show
 *
 * @param \STUBR\Apievents\Domain\Model\Event $event
 * @return void
 */
public function showAction(\STUBR\Apievents\Domain\Model\Event $event) {

    // Set plugin.tx_apievents_displayevents.settings.something to value x
    // --> how?

    // go on

    $this->view->assign('event', $event);
}

So I could do in setup.txt

lib.something < plugin.tx_apievents_displayevents.settings.something

But how?

1
And, also: is there a way to set ANY TypoScript from PHP directly? Not just my extension's settings?Urs
if you set plugin.tx_apievents_displayevents.settings.something = value and then you'll get in your action using $this->settings['something'] and you can overwrite value as well $this->settings['something'] = x and in view $this->view->assign('settings', $this->settings); Is that you mean or something I get wrongGhanshyam Gohel
I wanted to access that setting from the TS context, from outside the extensionUrs
you can find all TS configuration of whole site in $GLOBALS['TSFE']->tmpl->setupGhanshyam Gohel
TS is configuration lang and converted into PHP multidimensional array so this is the array I guess. where you get the whole config. I did not try but we can push our value into this global array, I used it into one of my extension for news TS configGhanshyam Gohel

1 Answers

0
votes

This is essentially what a userFunc does. See https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/UserAndUserInt/Index.html However TS is usually used for configuration that is being used by code. Not the other way around. If you're looking for a way to store temporary values you could also look at the cache manager. What are you trying to do here?