Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Elements.php

function Elements::isA

Check whether the given element meets the given criterion.

Example:

Elements::isA('script', Elements::TEXT_RAW); // Returns true.

Elements::isA('script', Elements::TEXT_RCDATA); // Returns false.

Parameters

string $name The element name.:

int $mask One of the constants on this class.:

Return value

bool true if the element matches the mask, false otherwise.

4 calls to Elements::isA()
DOMTreeBuilder::endTag in vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php
An end-tag.
DOMTreeBuilder::startTag in vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php
Process the start tag.
OutputRules::element in vendor/masterminds/html5/src/HTML5/Serializer/OutputRules.php
Write an element.
OutputRules::text in vendor/masterminds/html5/src/HTML5/Serializer/OutputRules.php
Write a text node.

File

vendor/masterminds/html5/src/HTML5/Elements.php, line 503

Class

Elements
This class provides general information about HTML5 elements, including syntactic and semantic issues. Parsers and serializers can use this class as a reference point for information about the rules of various HTML5 elements.

Namespace

Masterminds\HTML5

Code

public static function isA($name, $mask) {
    return (static::element($name) & $mask) === $mask;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal