Back to WebAssetItem class

Method setAttribute

public self
setAttribute
(string $key, mixed $value = null)
Set the attribute
Parameters
  • string $key An attribute key
  • string $value An attribute value
Returns
  • self
Since
  • 4.0.0
Class: WebAssetItem
Project: Joomla

Method setAttribute - Source code

/**
 * Set the attribute
 *
 * @param   string  $key    An attribute key
 * @param   string  $value  An attribute value
 *
 * @return self
 *
 * @since   4.0.0
 */
public function setAttribute(string $key, $value = null) : WebAssetItemInterface
{
    $this->attributes[$key] = $value;
    return $this;
}