‪TYPO3CMS  10.4
TYPO3\CMS\Core\TypoScript\TypoScriptService Class Reference

Public Member Functions

array convertTypoScriptArrayToPlainArray (array $typoScriptArray)
 
array convertPlainArrayToTypoScriptArray (array $plainArray)
 
array explodeConfigurationForOptionSplit (array $originalConfiguration, int $splitCount)
 

Detailed Description

Utilities to manage and convert TypoScript Also contains the functionality in TypoScript called "optionSplit"

Definition at line 24 of file TypoScriptService.php.

Member Function Documentation

◆ convertPlainArrayToTypoScriptArray()

array TYPO3\CMS\Core\TypoScript\TypoScriptService::convertPlainArrayToTypoScriptArray ( array  $plainArray)

Returns an array with Typoscript the old way (with dot).

Extbase converts the "classical" TypoScript (with trailing dot) to a format without trailing dot, to be more future-proof and not to have any conflicts with Fluid object accessor syntax. However, if you want to call legacy TypoScript objects, you somehow need the "old" syntax (because this is what TYPO3 is used to). With this method, you can convert the extbase TypoScript to classical TYPO3 TypoScript which is understood by the rest of TYPO3.

Parameters
array$plainArray‪A TypoScript Array with Extbase Syntax (without dot but with _typoScriptNodeValue)
Returns
‪array Array with TypoScript as usual (with dot)

Definition at line 67 of file TypoScriptService.php.

Referenced by TYPO3\CMS\FluidStyledContent\ViewHelpers\Link\ClickEnlargeViewHelper\renderStatic().

◆ convertTypoScriptArrayToPlainArray()

array TYPO3\CMS\Core\TypoScript\TypoScriptService::convertTypoScriptArrayToPlainArray ( array  $typoScriptArray)

Removes all trailing dots recursively from TS settings array

Extbase converts the "classical" TypoScript (with trailing dot) to a format without trailing dot, to be more future-proof and not to have any conflicts with Fluid object accessor syntax.

Parameters
array$typoScriptArray‪The TypoScript array (e.g. array('foo' => 'TEXT', 'foo.' => array('bar' => 'baz')))
Returns
‪array e.g. array('foo' => array('_typoScriptNodeValue' => 'TEXT', 'bar' => 'baz'))

Definition at line 36 of file TypoScriptService.php.

◆ explodeConfigurationForOptionSplit()

array TYPO3\CMS\Core\TypoScript\TypoScriptService::explodeConfigurationForOptionSplit ( array  $originalConfiguration,
int  $splitCount 
)

Implementation of the "optionSplit" feature in TypoScript (used eg. for MENU objects) What it does is to split the incoming TypoScript array so that the values are exploded by certain strings ("||" and "|*|") and each part distributed into individual TypoScript arrays with a similar structure, but individualized values. The concept is known as "optionSplit" and is rather advanced to handle but quite powerful, in particular for creating menus in TYPO3.

Parameters
array$originalConfiguration‪A TypoScript array
int$splitCount‪The number of items for which to generated individual TypoScript arrays
Returns
‪array The individualized TypoScript array.

Definition at line 97 of file TypoScriptService.php.