MediaWiki  master
SkinComponentUtils.php
Go to the documentation of this file.
1 <?php
2 
3 namespace MediaWiki\Skin;
4 
15  public static function addClassToClassList( $class, string $newClass ) {
16  if ( is_array( $class ) ) {
17  $class[] = $newClass;
18  } else {
19  $class .= ' ' . $newClass;
20  $class = trim( $class );
21  }
22  return $class;
23  }
24 }
static addClassToClassList( $class, string $newClass)
Adds a class to the existing class value, supporting it as a string or array.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...