You are here

public static function Pattern::hasValidContext in UI Patterns 8

Whereas pattern has a valid context, i.e. context "type" is set.

Parameters

array $element: Render array.

Return value

bool TRUE or FALSE.

1 call to Pattern::hasValidContext()
Pattern::processContext in src/Element/Pattern.php
Process context.

File

src/Element/Pattern.php, line 234

Class

Pattern
Renders a pattern element.

Namespace

Drupal\ui_patterns\Element

Code

public static function hasValidContext(array $element) {
  return isset($element['#context']) && is_array($element['#context']) && !empty($element['#context']['type']);
}