You are here

public static function PatternPreview::processContext in UI Patterns 8

Process context.

Parameters

array $element: Render array.

Return value

array Render array.

Throws

\Drupal\ui_patterns\Exception\PatternRenderException Throws an exception if no context type is specified.

Overrides Pattern::processContext

File

src/Element/PatternPreview.php, line 79

Class

PatternPreview
Renders a pattern preview element.

Namespace

Drupal\ui_patterns\Element

Code

public static function processContext(array $element) {
  $element['#context'] = new PatternContext('preview');
  return $element;
}