public function TwigExtension::renderPatternPreview in UI Patterns 8
Render given pattern.
Parameters
string $id: Pattern ID.
string $variant: Variant name.
Return value
array Pattern render array.
See also
\Drupal\ui_patterns\Element\Pattern
File
- src/
Template/ TwigExtension.php, line 66
Class
- TwigExtension
- Class UiPatternsTwigExtension.
Namespace
Drupal\ui_patterns\TemplateCode
public function renderPatternPreview($id, $variant = "") {
return [
'#type' => 'pattern_preview',
'#id' => $id,
'#variant' => $variant,
];
}