MobileFrontend
Mobile optimised frontend for MediaWiki
Loading...
Searching...
No Matches
MobileFrontend\Transforms\Utils\HtmlClassUtils Class Reference

Simple utility for working with html classes as with set. More...

Static Public Member Functions

static parseClassString (string $classAttr)
 Parse html class string into set (array of string=>bool) where key is class name and values is always true.
 
static formClassString (array $classes)
 Forms raw html class string from set of classes.
 
static filterAllowedClasses (array $classes, array $allowedClasses, array $additional)
 Filters set of classes by list of allowed classes.
 

Detailed Description

Simple utility for working with html classes as with set.

Member Function Documentation

◆ filterAllowedClasses()

static MobileFrontend\Transforms\Utils\HtmlClassUtils::filterAllowedClasses ( array $classes,
array $allowedClasses,
array $additional )
static

Filters set of classes by list of allowed classes.

Parameters
array$classeskey-value array of html classes
string[]$allowedClasseslist of allowed classes
string[]$additionallist of additional styles should be added in front of list
Returns
array

◆ formClassString()

static MobileFrontend\Transforms\Utils\HtmlClassUtils::formClassString ( array $classes)
static

Forms raw html class string from set of classes.

Set is a key-value array where key is class name and value is boolean that determines wheather this class should be included to string or not.

Parameters
array$classesset of classes that should be formed into string
Returns
string

◆ parseClassString()

static MobileFrontend\Transforms\Utils\HtmlClassUtils::parseClassString ( string $classAttr)
static

Parse html class string into set (array of string=>bool) where key is class name and values is always true.

Parameters
string$classAttrraw class attribute's string retrieved from html
Returns
array

The documentation for this class was generated from the following file: