You are here

public function TwigExtension::renderPattern in UI Patterns 8

Render given pattern.

Parameters

string $id: Pattern ID.

array $fields: Pattern fields.

string $variant: Variant name.

Return value

array Pattern render array.

See also

\Drupal\ui_patterns\Element\Pattern

File

src/Template/TwigExtension.php, line 44

Class

TwigExtension
Class UiPatternsTwigExtension.

Namespace

Drupal\ui_patterns\Template

Code

public function renderPattern($id, array $fields = [], $variant = "") {
  return [
    '#type' => 'pattern',
    '#id' => $id,
    '#fields' => $fields,
    '#variant' => $variant,
  ];
}