public static function updateClasses(Tag &$Tag)
    {
        if (empty($Tag->classes) && isset($Tag->attributes['class'])) {
            $classes = explode(' ', $Tag->attributes['class']);
        } elseif (!empty($Tag->classes)) {
            $classes = $Tag->classes;
        }

        if (isset($classes)) {
            sort($classes);
            $Tag->classes = $classes;
            $Tag->attributes['class'] = implode(' ', $classes);
        }
    }
public static function updateClasses(Tag &$Tag)
    {
        if (empty($Tag->classes) && isset($Tag->attributes['class'])) {
            $classes = explode(' ', $Tag->attributes['class']);
        } elseif (!empty($Tag->classes)) {
            $classes = $Tag->classes;
        }

        if (isset($classes)) {
            sort($classes);
            $Tag->classes = $classes;
            $Tag->attributes['class'] = implode(' ', $classes);
        }
    }
public static function updateClasses ( Tag & $ Tag ) { if ( empty ( $ Tag -> classes ) && isset ( $ Tag -> attributes [ 'class' ] ) ) { $ classes = explode ( ' ' , $ Tag -> attributes [ 'class' ] ) ; } elseif ( ! empty ( $ Tag -> classes ) ) { $ classes = $ Tag -> classes ; } if ( isset ( $ classes ) ) { sort ( $ classes ) ; $ Tag -> classes = $ classes ; $ Tag -> attributes [ 'class' ] = implode ( ' ' , $ classes ) ; } }
Builds an array of classes by seperating the class attribute by spaces
If if was not build before

If the classes array exists the attributes class will be updates

@param Tag &$Tag the current Tag

@return void
Builds an array of classes by seperating the class attribute by spaces If if was not build before