public static Html::getClass($class)
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.
File
- core/lib/Drupal/Component/Utility/Html.php, line 70
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]; }
Please login to continue.