You are here

public static function Html::getClass in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Utility/Html.php \Drupal\Component\Utility\Html::getClass()

Prepares a string for use as a valid class name.

Do not pass one string containing multiple classes as they will be incorrectly concatenated with dashes, i.e. "one two" will become "one-two".

Parameters

string $class: The class name to clean.

Return value

string The cleaned class name.

18 calls to Html::getClass()
BlockContentForm::form in core/modules/block_content/src/BlockContentForm.php
Gets the actual form array to be built.
BlockContentTypeTest::testsBlockContentAddTypes in core/modules/block_content/src/Tests/BlockContentTypeTest.php
Tests that redirects work as expected when multiple block types exist.
BlockForm::submitForm in core/modules/block/src/BlockForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…
BlockListBuilder::buildBlocksForm in core/modules/block/src/BlockListBuilder.php
Builds the main "Blocks" portion of the form.
BlockRenderOrderTest::testBlockRenderOrder in core/modules/block/src/Tests/BlockRenderOrderTest.php
Tests the render order of the blocks.

... See full list

File

core/lib/Drupal/Component/Utility/Html.php, line 56
Contains \Drupal\Component\Utility\Html.

Class

Html
Provides DOMDocument helpers for parsing and serializing HTML strings.

Namespace

Drupal\Component\Utility

Code

public static function getClass($class) {
  if (!isset(static::$classes[$class])) {
    static::$classes[$class] = static::cleanCssIdentifier(Unicode::strtolower($class));
  }
  return static::$classes[$class];
}