public static function addCssClass($className, &$htmlOptions)
    {
        // Always operate on arrays
        if (is_string($className)) {
            $className = explode(' ', $className);
        }
        if (isset($htmlOptions['class'])) {
            $classes = array_filter(explode(' ', $htmlOptions['class']));
            foreach ($className as $class) {
                $class = trim($class);
                // Don't add the class if it already exists
                if (array_search($class, $classes) === false) {
                    $classes[] = $class;
                }
            }
            $className = $classes;
        }
        $htmlOptions['class'] = implode(' ', $className);
    }
public static function addCssClass($className, &$htmlOptions)
    {
        // Always operate on arrays
        if (is_string($className)) {
            $className = explode(' ', $className);
        }
        if (isset($htmlOptions['class'])) {
            $classes = array_filter(explode(' ', $htmlOptions['class']));
            foreach ($className as $class) {
                $class = trim($class);
                // Don't add the class if it already exists
                if (array_search($class, $classes) === false) {
                    $classes[] = $class;
                }
            }
            $className = $classes;
        }
        $htmlOptions['class'] = implode(' ', $className);
    }
public static function addCssClass ( $ className , & $ htmlOptions ) { // Always operate on arrays if ( is_string ( $ className ) ) { $ className = explode ( ' ' , $ className ) ; } if ( isset ( $ htmlOptions [ 'class' ] ) ) { $ classes = array_filter ( explode ( ' ' , $ htmlOptions [ 'class' ] ) ) ; foreach ( $ className as $ class ) { $ class = trim ( $ class ) ; // Don't add the class if it already exists if ( array_search ( $ class , $ classes ) === false ) { $ classes [ ] = $ class ; } } $ className = $ classes ; } $ htmlOptions [ 'class' ] = implode ( ' ' , $ className ) ; }
Appends new class names to the given options..
@param mixed $className the class(es) to append.
@param array $htmlOptions the options.
@return array the options.
Appends new class names to the given options ..