public static function addAttributeClass($view, $class, $prepend = false, $key = 'attr')
    {
        if ($view instanceof BlockView || $view instanceof FormView) {
            $attr = isset($view->vars[$key]) ? $view->vars[$key] : [];
            $attrClass = isset($attr['class']) ? $attr['class'] : '';
            $attrClass = $prepend ? trim($class.' '.$attrClass) : trim($attrClass.' '.$class);

            static::addAttribute($view, 'class', $attrClass, $key);
        }
    }
public static function addAttributeClass($view, $class, $prepend = false, $key = 'attr')
    {
        if ($view instanceof BlockView || $view instanceof FormView) {
            $attr = isset($view->vars[$key]) ? $view->vars[$key] : [];
            $attrClass = isset($attr['class']) ? $attr['class'] : '';
            $attrClass = $prepend ? trim($class.' '.$attrClass) : trim($attrClass.' '.$class);

            static::addAttribute($view, 'class', $attrClass, $key);
        }
    }
public static function addAttributeClass ( $ view , $ class , $ prepend = false , $ key = 'attr' ) { if ( $ view instanceof BlockView || $ view instanceof FormView ) { $ attr = isset ( $ view -> vars [ $ key ] ) ? $ view -> vars [ $ key ] : [ ] ; $ attrClass = isset ( $ attr [ 'class' ] ) ? $ attr [ 'class' ] : '' ; $ attrClass = $ prepend ? trim ( $ class . ' ' . $ attrClass ) : trim ( $ attrClass . ' ' . $ class ) ; static :: addAttribute ( $ view , 'class' , $ attrClass , $ key ) ; } }
Add class attribute of view.

@param BlockView|FormView $view    The block or form view
@param string             $class   The css classname of class attr
@param bool               $prepend Check if the classname must be added at start or at end
@param string             $key     The array key of attribute in view vars
Add class attribute of view .