function saveClass($className = '') {
        $css = $this->css();
        if ($css === '') return false;
        if (isset(self::$_cssIndex[$css])) {
            $className = self::$_cssIndex[$css];
        } else {
            if ($className === '') {
                $classNamePrefix = 'class';
                $className = $classNamePrefix . rand(0, 2000000000);
            } else {
                $classNamePrefix = $className;
            }
            while (isset(self::$_classes[$className])) {
                $className = $classNamePrefix . rand(0, 2000000000);
            }
            self::$_classes[$className] = true;
            self::$_cssIndex[$css] = $className;
            $this->_assets->addStyle($css, '.'.$className);
        }

        return $className;
    }
function saveClass($className = '') {
        $css = $this->css();
        if ($css === '') return false;
        if (isset(self::$_cssIndex[$css])) {
            $className = self::$_cssIndex[$css];
        } else {
            if ($className === '') {
                $classNamePrefix = 'class';
                $className = $classNamePrefix . rand(0, 2000000000);
            } else {
                $classNamePrefix = $className;
            }
            while (isset(self::$_classes[$className])) {
                $className = $classNamePrefix . rand(0, 2000000000);
            }
            self::$_classes[$className] = true;
            self::$_cssIndex[$css] = $className;
            $this->_assets->addStyle($css, '.'.$className);
        }

        return $className;
    }
function saveClass ( $ className = '' ) { $ css = $ this -> css ( ) ; if ( $ css === '' ) return false ; if ( isset ( self :: $ _cssIndex [ $ css ] ) ) { $ className = self :: $ _cssIndex [ $ css ] ; } else { if ( $ className === '' ) { $ classNamePrefix = 'class' ; $ className = $ classNamePrefix . rand ( 0 , 2000000000 ) ; } else { $ classNamePrefix = $ className ; } while ( isset ( self :: $ _classes [ $ className ] ) ) { $ className = $ classNamePrefix . rand ( 0 , 2000000000 ) ; } self :: $ _classes [ $ className ] = true ; self :: $ _cssIndex [ $ css ] = $ className ; $ this -> _assets -> addStyle ( $ css , '.' . $ className ) ; } return $ className ; }
Save CSS style with specified classname selector with reusing already defined classnames
@param string $className Preferred classname, if not specified, classname will be random
@return bool|string specified className or already existing class name with same style
Save CSS style with specified classname selector with reusing already defined classnames