function public function Element::isType

8.x-3.x Element.php public Element::isType($type)

Checks if the element is a specific type of element.

Parameters

string|array $type: The element type(s) to check.

Return value

bool TRUE if element is or one of $type.

Class

Element
Provides helper methods for Drupal render elements.

Namespace

Drupal\bootstrap\Utility

Source src/Utility/Element.php (line 494)

public function isType($type) {
  $property = $this->getProperty('type');
  return $property && in_array($property, (is_array($type) ? $type : [$type]));
}