interface IconBuilderInterface (View source)

Provides an interface for building layout icons.

Methods

array
build(array $icon_map)

Builds a render array representation of an SVG based on an icon map.

$this
setId(string $id)

Sets the ID.

$this
setLabel(string $label)

Sets the label.

$this
setWidth(int $width)

Sets the width.

$this
setHeight(int $height)

Sets the height.

$this
setPadding(int $padding)

Sets the padding.

$this
setStrokeWidth(int|null $stroke_width)

Sets the stroke width.

Details

array build(array $icon_map)

Builds a render array representation of an SVG based on an icon map.

Parameters

array $icon_map
A two-dimensional array representing the visual output of the layout. For the following shape: ------------------------------
100%
------- -------------- -------
50% 25%
25% -------------- -------
75%
------------------------------

The corresponding array would be:

  • ['top']
  • ['first', 'second', 'second', 'third']
  • ['first', 'bottom', 'bottom', 'bottom'].

Return Value

array

A render array representing a SVG icon.

$this setId(string $id)

Sets the ID.

Parameters

string $id

The machine name of the layout.

Return Value

$this

$this setLabel(string $label)

Sets the label.

Parameters

string $label

The label of the layout.

Return Value

$this

$this setWidth(int $width)

Sets the width.

Parameters

int $width

The width of the SVG.

Return Value

$this

$this setHeight(int $height)

Sets the height.

Parameters

int $height

The height of the SVG.

Return Value

$this

$this setPadding(int $padding)

Sets the padding.

Parameters

int $padding

The padding between regions.

Return Value

$this

$this setStrokeWidth(int|null $stroke_width)

Sets the stroke width.

Parameters

int|null $stroke_width

The width of region borders.

Return Value

$this