Prepend to attribute by name.

@param string $name
@param mixed  $value

@return \HnhDigital\NavigationBuilder\Item
171286
public function prependAttribute($name, ...$value)
    {
        list($current_value, $separator) = $this->manipulateAttribute($name, $value);

        foreach ($value as $attribute_value) {
            array_unshift($current_value, $attribute_value);
        }

        $this->updateAttribute($name, $current_value, $separator);

        return $this;
    }
572205
public function appendAttributes($name, $value, $fieldset = null, $group = null)
    {
        foreach ($this->getFields($fieldset, $group) as $field) {
            $field->appendAttribute($name, $value);
        }

        return $this;
    }
19002
public static function attr($name, $value = null)
    {
        if (is_string($name)) {
            $name = [$name => $value];
        }

        return HtmlBuilder::buildAttributes($name);
    }
647712
public function add($name, $value)
    {
        $this->arguments[] = '--add';
        $this->arguments[] = $name;
        $this->arguments[] = $value;
        return $this;
    }
221739
public function append($name, $value)
    {
        if (is_array($this->_data[$name])) {
            $this->_data[$name][] = $value;
        } else {
            $this->_data[$name] .= $value;
        }

        return $this;
    }
177025
public function put($name, $value = null)
    {
        if ($name == []) {
            return $this;
        }

        $newValues = $name;

        if (! is_array($name)) {
            $newValues = [$name => $value];
        }

        $newContent = array_merge($this->all(), $newValues);

        $this->setContent($newContent);

        return $this;
    }
758369
public function setAttribute($name, ...$value)
    {
        $value = is_array(array_get($value, 0, '')) ? array_get($value, 0) : $value;
        $this->updateAttribute($name, $value, $this->getAttributeValueSeparator($name));

        return $this;
    }
698806
public function setAttribute($name, $value) {
		if(!isset($this->payload['params']['Data'])) {
			$this->payload['params']['Data'] = array();
		}

		if(!isset($this->payload['params']['Data']['Attributes'])) {
			$this->payload['params']['Data']['Attributes'] = array();
		}
		$this->payload['params']['Data']['Attributes'][$name] = Trustly_Data::ensureUTF8($value);
		return $value;
	}
1150344
public function addAttributes($name, $value)
    {
        if (empty($this->attributes[$name]))
            $this->attributes[$name] = [];

        $this->attributes[$name][] = $value;

        return $this;
    }
979182
public function withAttribute($name, $value){
        if(!is_string($name)){
            throw new \InvalidArgumentException(
                "First argument must be of the type string, " . gettype($name) . " given."
            );
        }

        if(
            array_key_exists($name, $this->attributes)
            && $this->attributes[$name] === $value
        ){
            return $this;
        }

        $clone                      = clone $this;
        $clone->attributes[$name]   = $value;

        return $clone;
    }
637020
public function setAttr(string $name, string $value)
    {
        $this->attr[$name] = $value;

        return $this;
    }
941214
public function addAttribute($name = null, $value)
    {
        if ($value) {
            $this->attributes[$name] = $value;
        }
        return $this;
    }
1361771
public function setHeader($name, $value)
    {
        $name = trim($name);
        $this->headers[$name] = trim($value);

        return $this;
    }
777805
public function setHeader($name, $value)
    {
        $headerSet = $this->getSwiftMessage()->getHeaders();

        if ($headerSet->has($name)) {
            $headerSet->remove($name);
        }

        foreach ((array)$value as $v) {
            $headerSet->addTextHeader($name, $v);
        }

        return $this;
    }
351310
public function withHeader($name, $value)
    {
        $new = clone $this;
        $name = $this->normalizeHeaderName($name);
        $new->_environment[$name] = $value;

        return $new;
    }
299766
public function attr($name, $value = null)
    {
        if (func_num_args() < 2) {
            return @$this->attributes[$name];
        } else {
            if (is_null($value)) {
                unset($this->attributes[$name]);
            } else {
                $this->attributes[$name] = $value;
            }
            return $this;
        }
    }
74753
private function makeAttribute($name, $value)
    {
        $attribute = Attribute::make($name, $value);

        $this->put($attribute->getName(), $attribute);

        return $this;
    }