public function get_and_erase_attributes($classname) {
        $attributes = $this->attributes;
        $this->attributes = array();
        if (empty($attributes['class'])) {
            $attributes['class'] = '';
        }
        $attributes['class'] = $classname . ' '. $attributes['class'];
        return $attributes;
    }
public function get_and_erase_attributes($classname) {
        $attributes = $this->attributes;
        $this->attributes = array();
        if (empty($attributes['class'])) {
            $attributes['class'] = '';
        }
        $attributes['class'] = $classname . ' '. $attributes['class'];
        return $attributes;
    }
public function get_and_erase_attributes ( $ classname ) { $ attributes = $ this -> attributes ; $ this -> attributes = array ( ) ; if ( empty ( $ attributes [ 'class' ] ) ) { $ attributes [ 'class' ] = '' ; } $ attributes [ 'class' ] = $ classname . ' ' . $ attributes [ 'class' ] ; return $ attributes ; }
Return all attributes and erases them so they are not applied again

@param string $classname adds additional class name to the beginning of $attributes['class']
@return array
Return all attributes and erases them so they are not applied again