You are here

public function IconBuilderInterface::build in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Layout/Icon/IconBuilderInterface.php \Drupal\Core\Layout\Icon\IconBuilderInterface::build()
  2. 9 core/lib/Drupal/Core/Layout/Icon/IconBuilderInterface.php \Drupal\Core\Layout\Icon\IconBuilderInterface::build()

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

Parameters

string[][] $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.

1 method overrides IconBuilderInterface::build()
SvgIconBuilder::build in core/lib/Drupal/Core/Layout/Icon/SvgIconBuilder.php
Builds a render array representation of an SVG based on an icon map.

File

core/lib/Drupal/Core/Layout/Icon/IconBuilderInterface.php, line 37

Class

IconBuilderInterface
Provides an interface for building layout icons.

Namespace

Drupal\Core\Layout\Icon

Code

public function build(array $icon_map);