Set an attribute on all items in the menu.

@param string $attribute
@param string $value

@return $this
775546
public function setItemAttribute(string $attribute, string $value = '')
    {
        $this->applyToAll(function (HasHtmlAttributes $link) use ($attribute, $value) {
            $link->setAttribute($attribute, $value);
        });

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

        return $this;
    }
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;
        }
    }
589482
public function set_attribute($key, $value)
	{
		$attributes = $this->get_config('form_attributes', array());
		$attributes[$key] = $value;
		$this->set_config('form_attributes', $attributes);

		return $this;
	}
1366451
public function setAttributes($name, $value = null) 
	{
		Argument::i()
			->test(1, 'string', 'array')
			->test(2, 'scalar', 'null');
		
		if(is_array($name)) {
			$this->attributes = $name;
			return $this;
		}
		
		$this->attributes[$name] = $value;
		return $this;
	}
272726
public function setAttribute($attribute, $value = null)
    {
        if (is_array($attribute)) {
            $this->attributes = array_merge_recursive($this->attributes, $attribute);

            return $this;
        }

        if (is_array($value)) {
            $old = $this->attributes[$attribute] ?? [];
            $this->attributes[$attribute] = array_merge((array) $old, $value);
        } else {
            $this->attributes[$attribute] = $value;
        }

        return $this;
    }
523987
public function set(string $key, $value = true) : self
    {
        $this->attributes[$key] = $value;

        return $this;
    }
291724
public function setAttribute($attribute, $value)
    {
        // Give mutator priority over custom casts
        if ($this->hasSetMutator($attribute)) {
            $method = 'set' . studly_case($attribute) . 'Attribute';

            return $this->{$method}($value);
        }

        if (array_key_exists($attribute, $this->filterCustomCasts())) {
            /** @var $customCastObject CustomCastBase */
            $customCastObject = $this->getCustomCastObject($attribute);

            $this->attributes[$attribute] = $customCastObject->setAttribute($value);

            return $this;
        }

        parent::setAttribute($attribute, $value);
    }
213073
protected function setRequirementsForAttribute($attribute, array $value)
    {
        $parameters = [];

        foreach ($value as $attrValue) {
            $parameters = array_filter(array_merge(
                $parameters,
                self::getParametersInValue($attrValue)
            ));
        }

        if (!empty($parameters)) {
            $this->requirements[$attribute] = $parameters;
        }
    }
799210
public function setAttribute($attribute, $value, $scheme = null, $isComputed = false)
    {
        $this->attributes[$attribute] = $value;
        $this->scheme[$attribute] = $scheme;
        $this->is_computed[$attribute] = (true === $isComputed);

        return $this;
    }
1066892
public function attribute( string $attr, string $value ): Tag
    {
        $this->attributes[$attr] = $value;

        return $this;
    }
225478
public function setAttribute($attribute, $value)
    {
        if (is_string($attribute)) {
            if (false === strpos($attribute, '::')) {
                if (defined('\PDO::' . $attribute)) {
                    $attribute = '\PDO::' . $attribute;
                } else {
                    $attribute = __CLASS__ . '::' . $attribute;
                }
            }
            if (!defined($attribute)) {
                throw new InvalidArgumentException(sprintf(
                    'Invalid connection option/attribute name specified: "%s"',
                    $attribute
                ));
            }
            $attribute = constant($attribute);
        }
        switch ($attribute) {
            case self::PROPEL_ATTR_CACHE_PREPARES:
                $this->isCachePreparedStatements = $value;
                break;
            default:
                $this->connection->setAttribute($attribute, $value);
        }
    }
418009
public function put($key, $value = '')
    {
        Arr::set($this->attributes, $key, $value);

        return $this;
    }
293661
public function addAttribute($attribute, $value)
    {
        $value = is_array($value) ? $value : [$value];

        if (!isset($this->attributes[$attribute])) {
            $this->attributes[$attribute] = [];
        }
        foreach ($value as $attrValue) {
            $this->attributes[$attribute][] = $attrValue;
        }

        return $this;
    }
1045060
public function filter($attribute, $value)
    {
        $filter = $attribute . ':' . (is_array($value) ? implode(',', $value) : $value);

        if ($this->offsetExists('filter')) {
            $filter = $this->offsetGet('filter') . ';' . $filter;
        }

        $this->offsetSet('filter', $filter);

        return $this;
    }
1364796
public function attribute($attr, $value = '')
    {
        if (is_array($attr)) {
            foreach ($attr as $key => $value) {
                $this->attribute($key, $value);
            }
        } else {
            $this->attributes[$attr] = $value;
        }

        return $this;
    }
254929
public function withAttribute(string $name, $value = null)
    {
        $this->attributes[$name] = $value;

        return $this;
    }