src/HtmlElement.php
public function addClass($value) : self
    {
        $currentClasses = $this->getClasses();
        $classes = array_unique(array_merge($currentClasses, (is_array($value) ? $value : explode(' ', $value))));

        return $this->addAttribute('class', implode(' ', $classes));
    }
public function addClass($value) : self
    {
        $currentClasses = $this->getClasses();
        $classes = array_unique(array_merge($currentClasses, (is_array($value) ? $value : explode(' ', $value))));

        return $this->addAttribute('class', implode(' ', $classes));
    }
public function addClass ( $ value ) : self { $ currentClasses = $ this -> getClasses ( ) ; $ classes = array_unique ( array_merge ( $ currentClasses , ( is_array ( $ value ) ? $ value : explode ( ' ' , $ value ) ) ) ) ; return $ this -> addAttribute ( 'class' , implode ( ' ' , $ classes ) ) ; }
@param array|string $value

@return $this|self
@param array|string $value