Adds Attributes of Element.
@access		public
@param		string		$attributes	Map of Element Attributes
@return		void
775491
public function addAttributes( $attributes = array() )
	{
		foreach( $attributes as $key => $value )
		{
			if( $key == 'class' )
			{
				if( is_string( $value ) )
					$value	= explode( " ", $value );
				if( !is_array( $value ) && !( $value instanceof ArrayIterator ) )
					throw new InvalidArgumentException( 'Class attribute must be string, array or iterator' );
				foreach( $value as $class )
					$this->addClass( $class );
				continue;
			}
			else
				$this->attributes[$key]	= $value;
		}
	}
1361182
public function setAttributes(
        SimpleXMLElement $element,
        array $attributes
    ) {
        $storage = $element->attributes();
        foreach ($attributes as $key => $value) {
            if (isset($storage->{$key})) {
                $storage->{$key} = $value;
            } else {
                $element->addAttribute($key, $value);
            }
        }
    }
1259588
public function addAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
671605
public function addElement($attrs)
    {
        if (!$this->getPrefix($attrs['type'])) {
            $attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type'];
        }
        $this->elements[$attrs['name']] = $attrs;
        $this->elements[$attrs['name']]['typeClass'] = 'element';

        $this->xdebug("addElement " . $attrs['name']);
        $this->appendDebug($this->varDump($this->elements[$attrs['name']]));
    }
150434
public function add(array $attributes = array())
    {
        $item = MenuItem::make($attributes);

        $this->items[] = $item;

        return $item;
    }
1032725
public function init($attributes) 
    {
        $this->autoresize_types = array(  
            _('Fit to Width')      => 'max_width',
            _('Fit to Height')     => 'max_height',
            _('Scale')          => 'scale',
            _('Crop and Scale') => 'crop_and_scale',
        );

        parent::init($attributes);
        $this->fileInput = new FileInput( $this->name, $attributes);

        $this->imageCover = new Div(array('class' => 'formkit-image-cover'));
        $this->imageCover->setAttributeValue('data-width', $this->dataWidth ?: 200);
        $this->imageCover->setAttributeValue('data-height', $this->dataHeight);

        $this->inputWrapper = new Div;
        $this->inputWrapper
            ->addClass('formkit-widget-thumbimagefile')
            ->addClass('formkit-image-wrapper');

        // if it has a value, generate img
        if ($this->renderImageTag && $this->value) {
            $this->image = new Element('img',array(
                'src' => $this->prefix . $this->value,
            ));
            $this->imageCover->append($this->image);
        }

        if ($this->value) {
            $this->fileInput->setAttributeValue('data-image-src', $this->prefix . $this->value);
        }
        if ($this->exif) {
            $this->fileInput->setAttributeValue('data-exif', 'true');
        }
        if ($this->autoresize) {
            $this->fileInput->setAttributeValue('data-autoresize','true');
        }
        if ($this->droppreview) {
            $this->fileInput->setAttributeValue('data-droppreview','true');
        }
        if ($this->dropupload) {
            $this->fileInput->setAttributeValue('data-dropupload','true');
        }

        $this->fileInput->setAttributeValue('data-width', $this->dataWidth);
        $this->fileInput->setAttributeValue('data-height', $this->dataHeight);


        $this->inputWrapper->append($this->imageCover);
        $this->inputWrapper->append($this->fileInput);

        if ($this->autoresize && $this->autoresize_input) {
            $this->fileInput->setAttributeValue('data-autoresize-input','true');
            $checkbox = new CheckboxInput($this->name . '_autoresize');
            $checkbox->addClass('autoresize-checkbox');

            if( $this->autoresize_input_check ) {
                $checkbox->check();
            }

            $checkboxId = $checkbox->getSerialId();

            $label    = new Label(_("Use auto-resize"));
            $label->for($checkboxId);
            $resizeWrapper = new Div;
            $resizeWrapper->append($checkbox);
            $resizeWrapper->append($label);
            $resizeWrapper->addClass("autoresize");
            $this->inputWrapper->append($resizeWrapper);

            if ($this->autoresize_type_input) {
                $resizeTypeWrapper = new Div;
                $resizeTypeWrapper->addClass('autoresize-type');
                $typeSelector = new SelectInput($this->name . '_autoresize_type', [
                    'options' => $this->autoresize_types,
                    'value'   => $this->autoresize_type,
                ]);
                $typeSelector->addClass('autoresize-type-selector');
                $resizeTypeWrapper->append($typeSelector);
                $this->inputWrapper->append($resizeTypeWrapper);
            }

        }
    }
243364
public function fill($attributes)
    {
        foreach ($attributes as $key => $value) {
            if (in_array($key, $this->fillable)) {
                $this->{$key} = $value;
            }
        }
    }
576995
final public function overwriteAttributes($attributes)
    {
        foreach($attributes as $key => $attribute)
        {
            if (isset($this->{$key}))
            {
                $this->{$key} = $attribute;
            }
        }

        return $attributes;
    }
532817
public function add( $key, $value ) {
		if ( ! array_key_exists( $key, $this->attributes ) ) {
			$this->attributes[ $key ] = $value;
		} else {
			if ( ! \is_array( $this->attributes[ $key ] ) ) {
				$this->attributes[ $key ] = array( $this->attributes[ $key ], $value );
			} else {
				$this->attributes[ $key ][] = $value;
			}
		}
	}
449297
public function setAttributes(array $attributes = [])
    {
        $this->attributes = array_merge($this->attributes, $attributes);
        isset($attributes['id']) ? $this->id         = $attributes['id'] : null;
        return $this;
    }
881717
public function add(string ...$tokens)
    {
        if (count($tokens) === 0) {
            return;
        }
        foreach ($tokens as $t) {
            if (in_array($t, $this->tokens)) {
                continue;
            }
            $this->tokens[] = $t;
        }
        $this->setAttributeValue();
    }
578153
public function setAttributes(array $attributes): void
    {
        $this->checkAttributeAssignable(array_keys($attributes));

        $this->setRawAttributes($attributes);
    }
682999
public function fill($attributes)
    {
        // Some context types have varying types
        if ($this->hasGetMutator('type')) {
            $this->type = $this->mutateAttribute('type', $this->getArrValue($attributes, 'type', $this->type));
        }

        // Set properties
        $properties = array_merge([
            '@context' => 'http://schema.org',
            '@type' => $this->type,
            'sameAs' => null
        ], $this->structure, $this->extendStructure);

        // Set properties from attributes
        foreach ($properties as $key => $property) {
            $this->setProperty($key, $property, $this->getArrValue($attributes, $key, ''));
        }

        // After fill event
        $this->afterFill($attributes);
    }
74039
public function addAttributes($attributes, $html = [])
    {
        if (!empty($attributes)) {
            foreach ($attributes as $key => $value) {
                if (!is_null($value)) {
                    $html[] = $key.'="'.Html::entities($value).'"';
                }
            }
        }

        return (count($html) > 0) ? ' '.implode(' ', $html) : '';
    }
138863
public void addAttributes(final Map<String, Object> attributes) {
        if (attributes != null) {
            for (final Map.Entry<String, Object> entry : attributes.entrySet()) {
                addAttribute(entry.getKey(), entry.getValue());
            }
        }
    }
699830
public function addElement($elementName, $content, $attributes = null)
    {
        $this->elements[$elementName]['name'] = $elementName;
        $this->elements[$elementName]['content'] = $content;
        $this->elements[$elementName]['attributes'] = $attributes;
    }
253096
public function fill(array $attributes)
    {
        foreach ($attributes as $key => $value) {
            if (array_search($key, $this->fillable) !== false) {
                $this->{$key} = $value;
            }
        }
    }