Contao Utils Bundle

FormatterUtil
in package

Table of Contents

Properties

$framework  : ContaoFramework
$insertTagParser  : InsertTagParser
$kernelBundles  : array<string|int, mixed>
$utils  : Utils

Methods

__construct()  : mixed
formatDcaFieldValue()  : mixed
Makes a DCA field value human-readable.
formatArray()  : string
formatInputUnitField()  : string
formatMultiColumnField()  : string
getTagModel()  : Adapter<string|int, Model>|Adapter<string|int, TagModel>|Model|TagModel|null
isMultiColumnsActive()  : bool

Properties

$kernelBundles

protected array<string|int, mixed> $kernelBundles

Methods

__construct()

public __construct(ContaoFramework $framework, InsertTagParser $insertTagParser, Utils $utils, array<string|int, mixed> $kernelBundles) : mixed
Parameters
$framework : ContaoFramework
$insertTagParser : InsertTagParser
$utils : Utils
$kernelBundles : array<string|int, mixed>

formatDcaFieldValue()

Makes a DCA field value human-readable.

public formatDcaFieldValue(DataContainer $dc, string $field, array<string|int, mixed>|string|null $value[, FormatDcaFieldValueOptions|null $settings = null ]) : mixed

This succeeds prepareSpecialValueForOutput(...) from Utils v2.

Parameters
$dc : DataContainer

The data container whose table to use and options-callback to evaluate.

$field : string

The DCA field name.

$value : array<string|int, mixed>|string|null

The value to format. If an array is passed, the values will be evaluated recursively.

$settings : FormatDcaFieldValueOptions|null = null

Additional settings.

Return values
mixed

The formatted value.

formatArray()

private formatArray(array<string|int, mixed> $values, FormatDcaFieldValueOptions $settings, Warning: Array to string conversion in phar:///usr/local/bin/phpDocumentor/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 64 callable(Array $value): string $callback) : string
Parameters
$values : array<string|int, mixed>
$settings : FormatDcaFieldValueOptions
$callback : Warning: Array to string conversion in phar:///usr/local/bin/phpDocumentor/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 64 callable(Array $value): string

The callback to format each value, possibly recursively.

Return values
string

formatInputUnitField()

private formatInputUnitField(array<string|int, mixed>|string|null $values, string $arraySeparator) : string
Parameters
$values : array<string|int, mixed>|string|null
$arraySeparator : string
Return values
string

formatMultiColumnField()

private formatMultiColumnField(array<string|int, mixed> $values, array<string|int, mixed> $data[, Warning: Array to string conversion in phar:///usr/local/bin/phpDocumentor/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 64 Warning: Array to string conversion in phar:///usr/local/bin/phpDocumentor/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 64 callable(Array $field, Array $value): string|null $callback = null ]) : string
Parameters
$values : array<string|int, mixed>
$data : array<string|int, mixed>
$callback : Warning: Array to string conversion in phar:///usr/local/bin/phpDocumentor/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 64 Warning: Array to string conversion in phar:///usr/local/bin/phpDocumentor/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 64 callable(Array $field, Array $value): string|null = null

Callback used to format each field value, possibly recursively.

Return values
string

getTagModel()

private getTagModel() : Adapter<string|int, Model>|Adapter<string|int, TagModel>|Model|TagModel|null
Tags
noinspection

PhpMixedReturnTypeCanBeReducedInspection

phpstan-ignore-next-line

For PHPStan, this method returns an object of an unknown class.

Return values
Adapter<string|int, Model>|Adapter<string|int, TagModel>|Model|TagModel|null

isMultiColumnsActive()

private isMultiColumnsActive() : bool
Return values
bool

        
On this page

Search results