public static function TwigSanitize::cleanClassArray in Twig Tools 8
Sanitizes all strings in an array for use as valid class names.
Parameters
array $classes: The array of class names to clean.
Return value
array A new array with the cleaned class names.
1 call to TwigSanitize::cleanClassArray()
- TwigSanitize::scrubClassArray in src/
TwigExtension/ TwigSanitize.php - Runs array through all of the Twig Tools sanitization filters.
File
- src/
TwigExtension/ TwigSanitize.php, line 40
Class
- TwigSanitize
- Class TwigSanitize.
Namespace
Drupal\twig_tools\TwigExtensionCode
public static function cleanClassArray(array $classes) {
return array_map(function ($class) {
return Html::getClass($class);
}, $classes);
}