protected function addClass($addClass) {
        $targetClass = $this->getAttrib('class');
        if(!empty($targetClass) && (strpos($targetClass, $addClass) === false)) {
            $targetClass .= " {$addClass}";
        } else {
            $targetClass = $addClass;
        }
        $this->setAttrib('class', $targetClass);
        return $this;
    }
protected function addClass($addClass) {
        $targetClass = $this->getAttrib('class');
        if(!empty($targetClass) && (strpos($targetClass, $addClass) === false)) {
            $targetClass .= " {$addClass}";
        } else {
            $targetClass = $addClass;
        }
        $this->setAttrib('class', $targetClass);
        return $this;
    }
protected function addClass ( $ addClass ) { $ targetClass = $ this -> getAttrib ( 'class' ) ; if ( ! empty ( $ targetClass ) && ( strpos ( $ targetClass , $ addClass ) === false ) ) { $ targetClass .= " {$addClass}" ; } else { $ targetClass = $ addClass ; } $ this -> setAttrib ( 'class' , $ targetClass ) ; return $ this ; }
Add a class to an existing class, taking care of spacing
@param string $targetClass  The existing class
@param string $addClass    the Class or classes to add, seperated by spaces
Add a class to an existing class taking care of spacing