src/Netzmacht/Bootstrap/Buttons/Factory.php
protected static function applyAttributes(Attributes $node, array $attributes, $fromFieldset = false)
    {
        if (empty($attributes)) {
            return;
        }

        if ($fromFieldset) {
            foreach ($attributes as $attribute) {
                if ($attribute['name']) {
                    if ($attribute['name'] == 'class') {
                        if (!$attribute['value']) {
                            return;
                        }

                        $attribute['value'] = explode(' ', $attribute['value']);
                    }
                    $node->setAttribute($attribute['name'], $attribute['value']);
                }
            }
        } else {
            foreach ($attributes as $name => $value) {
                if ($name) {
                    $node->setAttribute($name, $value);
                }
            }
        }
    }
protected static function applyAttributes(Attributes $node, array $attributes, $fromFieldset = false)
    {
        if (empty($attributes)) {
            return;
        }

        if ($fromFieldset) {
            foreach ($attributes as $attribute) {
                if ($attribute['name']) {
                    if ($attribute['name'] == 'class') {
                        if (!$attribute['value']) {
                            return;
                        }

                        $attribute['value'] = explode(' ', $attribute['value']);
                    }
                    $node->setAttribute($attribute['name'], $attribute['value']);
                }
            }
        } else {
            foreach ($attributes as $name => $value) {
                if ($name) {
                    $node->setAttribute($name, $value);
                }
            }
        }
    }
protected static function applyAttributes ( Attributes $ node , array $ attributes , $ fromFieldset = false ) { if ( empty ( $ attributes ) ) { return ; } if ( $ fromFieldset ) { foreach ( $ attributes as $ attribute ) { if ( $ attribute [ 'name' ] ) { if ( $ attribute [ 'name' ] == 'class' ) { if ( ! $ attribute [ 'value' ] ) { return ; } $ attribute [ 'value' ] = explode ( ' ' , $ attribute [ 'value' ] ) ; } $ node -> setAttribute ( $ attribute [ 'name' ] , $ attribute [ 'value' ] ) ; } } } else { foreach ( $ attributes as $ name => $ value ) { if ( $ name ) { $ node -> setAttribute ( $ name , $ value ) ; } } } }
Apply attributes.

@param Attributes $node         Attrbiutes alement.
@param array      $attributes   Html attributes which being applied.
@param bool       $fromFieldset Set true if attributes comes from fieldset definitions have to be transformed.

@return void
Apply attributes .