Settings 

\nn\t3::Settings() 

Methoden, um den Zugriff auf TypoScript Setup, Constanten und PageTsConfig zu vereinfachen.

Overview of Methods 

\nn\t3::Settings()->addPageConfig($str = ''); 

Page-Config hinzufügen Alias zu \nn\t3::Registry()->addPageConfig( $str );

\nn\t3::Settings()->addPageConfig( 'test.was = 10' );
\nn\t3::Settings()->addPageConfig( '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:extname/Configuration/TypoScript/page.txt">' );
\nn\t3::Settings()->addPageConfig( '@import "EXT:extname/Configuration/TypoScript/page.ts"' );
Copied!

| @return void

| ➜ Go to source code of Settings::addPageConfig()

\nn\t3::Settings()->get($extensionName = '', $path = ''); 

Holt das TypoScript-Setup und dort den Abschnitt "settings". Werte aus dem FlexForm werden dabei nicht gemerged. Alias zu \nn\t3::Settings()->getSettings().

\nn\t3::Settings()->get( 'nnsite' );
\nn\t3::Settings()->get( 'nnsite', 'path.in.settings' );
Copied!

| @return array

| ➜ Go to source code of Settings::get()

\nn\t3::Settings()->getCachedTyposcript(); 

High-Peformance-Version für das Initialisieren des TSFE im Backend. Das komplette TypoScript Setup holen, inkl. '.'-Syntax.

Wird über Filecache gespeichert.

\nn\t3::Settings()->getCachedTyposcript();
Copied!

| @return array

| ➜ Go to source code of Settings::getCachedTyposcript()

\nn\t3::Settings()->getConstants($tsPath = ''); 

Array der TypoScript-Konstanten holen.

\nn\t3::Settings()->getConstants();
\nn\t3::Settings()->getConstants('pfad.zur.konstante');
Copied!

Existiert auch als ViewHelper:

{nnt3:ts.constants(path:'pfad.zur.konstante')}
Copied!

| @return array

| ➜ Go to source code of Settings::getConstants()

\nn\t3::Settings()->getExtConf($extName = ''); 

Extension-Konfiguration holen. Kommen aus der LocalConfiguration.php, werden über die Extension-Einstellungen im Backend bzw. ext_conf_template.txt definiert

Früher: $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['your_extension_key']

\nn\t3::Settings()->getExtConf( 'extname' );
Copied!

| @return mixed

| ➜ Go to source code of Settings::getExtConf()

\nn\t3::Settings()->getFromPath($tsPath = '', $setup = NULL); 

Setup von einem gegebenen Pfad holen, z.B. 'plugin.tx_example.settings'

\nn\t3::Settings()->getFromPath('plugin.pfad');
\nn\t3::Settings()->getFromPath('L', \nn\t3::Request()->GP());
\nn\t3::Settings()->getFromPath('a.b', ['a'=>['b'=>1]]);
Copied!

Existiert auch als ViewHelper:

{nnt3:ts.setup(path:'pfad.zur.setup')}
Copied!

| @return array

| ➜ Go to source code of Settings::getFromPath()

\nn\t3::Settings()->getFullTypoScriptFromConfigurationManager(); 

Vollständiges TypoScript über den Configuration Manager holen.

Ein simpler Wrapper für die Core-Funktion aber mit try { ... } catch() Fallback.

Funktioniert nicht in jedem Kontext – z.B. nicht im CLI-Kontext! Besser: \nn\t3::Settings()->parseTypoScriptForPage(); verwenden.

Gibt die Notation mit Punkten zurück. Das kann per | \nn\t3::TypoScript()->convertToPlainArray() in ein normales Array umgewandelt werden.

// ==> ['plugin.']['example.'][...]
$setup = \nn\t3::Settings()->getFullTypoScriptFromConfigurationManager();
Copied!

| @return array

| ➜ Go to source code of Settings::getFullTypoScriptFromConfigurationManager()

\nn\t3::Settings()->getFullTyposcript($pid = NULL); 

Das komplette TypoScript Setup holen, als einfaches Array - ohne "."-Syntax Funktioniert sowohl im Frontend als auch Backend, mit und ohne übergebener pid

\nn\t3::Settings()->getFullTyposcript();
\nn\t3::Settings()->getFullTyposcript( $pid );
Copied!

| @return array

| ➜ Go to source code of Settings::getFullTyposcript()

\nn\t3::Settings()->getMergedSettings($extensionName = NULL, $ttContentUidOrSetupArray = []); 

Merge aus TypoScript-Setup für ein Plugin und seinem Flexform holen. Gibt das TypoScript-Array ab plugin.tx_extname.settings... zurück.

Wichtig: $extensionName nur angeben, wenn das Setup einer FREMDEN Extension geholt werden soll oder es keinen Controller-Context gibt, weil der Aufruf aus dem Backend gemacht wird... sonst werden die FlexForm-Werte nicht berücksichtigt!

Im FlexForm <settings.flexform.varName> verwenden! | <settings.flexform.varName> überschreibt dann settings.varName im TypoScript-Setup

| $ttContentUidOrSetupArray kann uid eines tt_content-Inhaltselementes sein oder ein einfaches Array zum Überschreiben der Werte aus dem TypoScript / FlexForm

\nn\t3::Settings()->getMergedSettings();
\nn\t3::Settings()->getMergedSettings( 'nnsite' );
\nn\t3::Settings()->getMergedSettings( $extensionName, $ttContentUidOrSetupArray );
Copied!

| @return array

| ➜ Go to source code of Settings::getMergedSettings()

\nn\t3::Settings()->getPageConfig($tsPath = '', $pid = NULL); 

Page-Configuration holen

\nn\t3::Settings()->getPageConfig();
\nn\t3::Settings()->getPageConfig('RTE.default.preset');
\nn\t3::Settings()->getPageConfig( $tsPath, $pid );
Copied!

Existiert auch als ViewHelper:

{nnt3:ts.page(path:'pfad.zur.pageconfig')}
Copied!

| @return array

| ➜ Go to source code of Settings::getPageConfig()

\nn\t3::Settings()->getPlugin($extName = NULL); 

Das Setup für ein bestimmtes Plugin holen.

\nn\t3::Settings()->getPlugin('extname') ergibt TypoScript ab plugin.tx_extname...
Copied!

Wichtig: $extensionName nur angeben, wenn das Setup einer FREMDEN Extension geholt werden soll oder es keinen Controller-Context gibt, weil der Aufruf z.B. aus dem Backend gemacht wird

| @return array

| ➜ Go to source code of Settings::getPlugin()

\nn\t3::Settings()->getSettings($extensionName = '', $path = ''); 

Holt das TypoScript-Setup und dort den Abschnitt "settings". Werte aus dem FlexForm werden dabei nicht gemerged.

\nn\t3::Settings()->getSettings( 'nnsite' );
\nn\t3::Settings()->getSettings( 'nnsite', 'example.path' );
Copied!

| @return array

| ➜ Go to source code of Settings::getSettings()

\nn\t3::Settings()->getSiteConfig($request = NULL); 

Site-Konfiguration holen. Das ist die Konfiguration, die ab TYPO3 9 in den YAML-Dateien im Ordner /sites definiert wurden. Einige der Einstellungen sind auch über das Seitenmodul "Sites" einstellbar.

Im Kontext einer MiddleWare ist evtl. die site noch nicht geparsed / geladen. In diesem Fall kann der $request aus der MiddleWare übergeben werden, um die Site zu ermitteln.

$config = \nn\t3::Settings()->getSiteConfig();
$config = \nn\t3::Settings()->getSiteConfig( $request );
Copied!

| @return array

| ➜ Go to source code of Settings::getSiteConfig()

\nn\t3::Settings()->getStoragePid($extName = NULL); 

Aktuelle (ERSTE) StoragePid für das aktuelle Plugin holen. Gespeichert im TypoScript-Setup der Extension unter | plugin.tx_extname.persistence.storagePid bzw. im FlexForm des Plugins auf der jeweiligen Seite.

WICHTIG: Merge mit gewählter StoragePID aus dem FlexForm passiert nur, wenn $extNameleer gelassen wird.

\nn\t3::Settings()->getStoragePid();         // 123
\nn\t3::Settings()->getStoragePid('nnsite');   // 466
Copied!

| @return string

| ➜ Go to source code of Settings::getStoragePid()

\nn\t3::Settings()->getStoragePids($extName = NULL, $recursive = 0); 

ALLE storagePids für das aktuelle Plugin holen. Gespeichert als komma-separierte Liste im TypoScript-Setup der Extension unter | plugin.tx_extname.persistence.storagePid bzw. im FlexForm des Plugins auf der jeweiligen Seite.

WICHTIG: Merge mit gewählter StoragePID aus dem FlexForm passiert nur, wenn $extNameleer gelassen wird.

\nn\t3::Settings()->getStoragePids();                    // [123, 466]
\nn\t3::Settings()->getStoragePids('nnsite');          // [123, 466]
Copied!

Auch die child-PageUids holen? | true nimmt den Wert für "Rekursiv" aus dem FlexForm bzw. aus dem TypoScript der Extension von plugin.tx_extname.persistence.recursive

\nn\t3::Settings()->getStoragePids(true);                // [123, 466, 124, 467, 468]
\nn\t3::Settings()->getStoragePids('nnsite', true);        // [123, 466, 124, 467, 468]
Copied!

Alternativ kann für die Tiefe / Rekursion auch ein numerischer Wert übergeben werden.

\nn\t3::Settings()->getStoragePids(2);               // [123, 466, 124, 467, 468]
\nn\t3::Settings()->getStoragePids('nnsite', 2);       // [123, 466, 124, 467, 468]
Copied!

| @return array

| ➜ Go to source code of Settings::getStoragePids()

\nn\t3::Settings()->parseTypoScriptForPage($pageUid = 0, $request = NULL); 

TypoScript für bestimmte pageUid parsen.

Gibt die Notation mit Punkten zurück. Das kann per | \nn\t3::TypoScript()->convertToPlainArray() in ein normales Array umgewandelt werden.

// TypoScript für aktuelle pageUid holen
\nn\t3::Settings()->parseTypoScriptForPage();

// TypoScript für bestimmte pageUid holen
\nn\t3::Settings()->parseTypoScriptForPage(123);
Copied!
@param int $pid PageUid
@param ServerRequestInterface $request
@return array

| ➜ Go to source code of Settings::parseTypoScriptForPage()

\nn\t3::Settings()->setExtConf($extName = '', $key = '', $value = ''); 

Extension-Konfiguration schreiben. Schreibt eine Extension-Konfiguration in die LocalConfiguration.php. Die Werte können bei entsprechender Konfiguration in der ext_conf_template.txt auch über den Extension-Manager / die Extension Konfiguration im Backend bearbeitet werden.

\nn\t3::Settings()->setExtConf( 'extname', 'key', 'value' );
Copied!

| @return mixed

| ➜ Go to source code of Settings::setExtConf()

Methods