public function addClass($className) {
        $oldClassName    = $this->getAttributeValue('class');
        $oldClassNameArr = $oldClassName ? explode(' ', $oldClassName) : array();
        $classNameArr    = array_merge($oldClassNameArr, explode(' ', $className));
        // housekeeping
        $classNameArr    = array_unique(array_filter(array_map('trim', $classNameArr)));
        $this->setAttribute('class', implode(' ', $classNameArr));
    }
public function addClass($className) {
        $oldClassName    = $this->getAttributeValue('class');
        $oldClassNameArr = $oldClassName ? explode(' ', $oldClassName) : array();
        $classNameArr    = array_merge($oldClassNameArr, explode(' ', $className));
        // housekeeping
        $classNameArr    = array_unique(array_filter(array_map('trim', $classNameArr)));
        $this->setAttribute('class', implode(' ', $classNameArr));
    }
public function addClass ( $ className ) { $ oldClassName = $ this -> getAttributeValue ( 'class' ) ; $ oldClassNameArr = $ oldClassName ? explode ( ' ' , $ oldClassName ) : array ( ) ; $ classNameArr = array_merge ( $ oldClassNameArr , explode ( ' ' , $ className ) ) ; // housekeeping $ classNameArr = array_unique ( array_filter ( array_map ( 'trim' , $ classNameArr ) ) ) ; $ this -> setAttribute ( 'class' , implode ( ' ' , $ classNameArr ) ) ; }
Add a CSS class to the item body

@author Dieter Raber <dieter@taotesting.com>
@param $className one or more class names, separated by space
Add a CSS class to the item body