ArrayBrowser

class \TYPO3\CMS\Backend\View\ArrayBrowser

Class for displaying an array as a tree which can collapse / expand.

See the extension 'lowlevel' / config (Backend module 'Tools > Configuration')

Table of Contents

Properties

$depthKeys  : array
If set, the variable keys are not linked.
$expAll  : bool
$regexMode  : bool
If set, the values are truncated with "..." appended if longer than a certain length.
$searchKeys  : array
Array defining which keys to expand. Typically set from outside from some session variable - otherwise the array will collapse.
$searchKeysToo  : bool
If set, search for string with regex, otherwise stristr()
$route  : Route|null
If null then there are no links set.
$uriBuilder  : UriBuilder

Methods

__construct()  : mixed
depthKeys()  : array
Function modifying the depthKey array
getSearchKeys()  : array
Creates an array with "depthKeys" which will expand the array to show the search results
tree()  : string
Set var name here if you want links to the variable name.

Properties

$depthKeys

If set, the variable keys are not linked.

public array $depthKeys = []

$regexMode

If set, the values are truncated with "..." appended if longer than a certain length.

public bool $regexMode = false

$searchKeys

Array defining which keys to expand. Typically set from outside from some session variable - otherwise the array will collapse.

public array $searchKeys = []

$searchKeysToo

If set, search for string with regex, otherwise stristr()

public bool $searchKeysToo = true

$route

If null then there are no links set.

protected Route|null $route

Methods

__construct()

public __construct([Route|null $route = null ]) : mixed

Parameters

$route : Route|null = null

depthKeys()

Function modifying the depthKey array

public depthKeys(array $arr, array $settings) : array

Parameters

$arr : array

Array with instructions to open/close nodes.

$settings : array

Input depth_key array

Return values

array —

Output depth_key array with entries added/removed based on $arr

getSearchKeys()

Creates an array with "depthKeys" which will expand the array to show the search results

public getSearchKeys(array $keyArr, string $depth_in, string $searchString, array $keyArray) : array

Parameters

$keyArr : array

The array to search for the value

$depth_in : string

Depth string - blank for first call (will build up during recursive calling creating an id of the position: [key1].[key2].[key3]

$searchString : string

The string to search for

$keyArray : array

Key array, for first call pass empty array

Return values

array

tree()

Set var name here if you want links to the variable name.

public tree(array $array, string $positionKey) : string

Make browsable tree Before calling this function you may want to set some of the internal vars like depthKeys and regexMode.

Parameters

$array : array

The array to display

$positionKey : string

Key-position id. Build up during recursive calls - [key1].[key2].[key3] - and so on.

Return values

string —

HTML for the tree

On this page