src/Field.php
public static function array2attrs($assoc){
        $attrs = [];
        foreach ((array) $assoc as $key => $value) {
            $attrs[] = is_string($key)
                ? "$key='$value'"
                : trim($value);
        }
        return implode(' ', $attrs);
    }
public static function array2attrs($assoc){
        $attrs = [];
        foreach ((array) $assoc as $key => $value) {
            $attrs[] = is_string($key)
                ? "$key='$value'"
                : trim($value);
        }
        return implode(' ', $attrs);
    }
public static function array2attrs ( $ assoc ) { $ attrs = [ ] ; foreach ( ( array ) $ assoc as $ key => $ value ) { $ attrs [ ] = is_string ( $ key ) ? "$key='$value'" : trim ( $ value ) ; } return implode ( ' ' , $ attrs ) ; }
Get array and make attributes string

@example
['class'=>'testClass', 'name'=>'foo' 'value'=>'bar', "id='exampleId'"]
class='testClass' name='foo' value='bar' id='exampleId'

@category Rendering

@param array|object html attributes

@return string html attributes
Get array and make attributes string