PHP Class Contao\CoreBundle\DataContainer\PaletteManipulator

显示文件 Open project: contao/core-bundle Class Usage Examples

Public Methods

Method Description
addField ( string | array $name, string | array $parent, string $position = self::POSITION_AFTER, string | array | Closure | null $fallback = null, string $fallbackPosition = self::POSITION_APPEND ) : static Adds a new field.
addLegend ( string $name, string | array $parent, string $position = self::POSITION_AFTER, boolean $hide = false ) : static Adds a new legend.
applyToPalette ( string $name, string $table ) : static Applies the changes to a palette.
applyToString ( string $palette, boolean $skipLegends = false ) : string Applies the changes to a palette string.
applyToSubpalette ( string $name, string $table ) : static Applies the changes to a subpalette.
create ( ) : static Creates a new object instance.

Private Methods

Method Description
applyFallback ( array &$config, array $action, boolean $skipLegends = false ) Applies the fallback when adding a field fails.
applyFallbackPalette ( array &$config, array $action ) Aplies the fallback to a palette.
applyField ( array &$config, array $action, boolean $skipLegends = false ) Adds a new field to the configuration array.
applyFieldToField ( array &$config, array $action, boolean $skipLegends = false ) Adds a field after a field.
applyFieldToLegend ( array &$config, array $action, boolean $skipLegends = false ) Adds fields to a legend.
applyLegend ( array &$config, array $action ) Adds a new legend to the configuration array.
canApplyToParent ( array &$config, array $action, string $key, string $position ) : boolean Tries to apply to a parent.
explode ( string $palette ) : array Converts a palette string to a configuration array.
findLegendForField ( array &$config, string $field ) : string | false Searches all legends for a field.
implode ( array $config ) : string Converts a configuration array to a palette string.
validatePosition ( string $position ) Validates the position.

Method Details

addField() public method

If $position is PREPEND or APPEND, pass a legend as parent; otherwise pass a field name.
public addField ( string | array $name, string | array $parent, string $position = self::POSITION_AFTER, string | array | Closure | null $fallback = null, string $fallbackPosition = self::POSITION_APPEND ) : static
$name string | array
$parent string | array
$position string
$fallback string | array | Closure | null
$fallbackPosition string
return static

addLegend() public method

If the legend already exists, nothing will be changed.
public addLegend ( string $name, string | array $parent, string $position = self::POSITION_AFTER, boolean $hide = false ) : static
$name string
$parent string | array
$position string
$hide boolean
return static

applyToPalette() public method

Applies the changes to a palette.
public applyToPalette ( string $name, string $table ) : static
$name string
$table string
return static

applyToString() public method

Applies the changes to a palette string.
public applyToString ( string $palette, boolean $skipLegends = false ) : string
$palette string
$skipLegends boolean
return string

applyToSubpalette() public method

Applies the changes to a subpalette.
public applyToSubpalette ( string $name, string $table ) : static
$name string
$table string
return static

create() public static method

Creates a new object instance.
public static create ( ) : static
return static