Skip to content
PHP Ecosystem
Explore

HasDownload

API reference › HTML Attribute › HasDownload

traitUIAwesome\Html\Attribute\HasDownload
Sourcesrc/HasDownload.php
Used by 1 type

Provides an immutable API for the download attribute.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#download.

MethodDescriptionDefined by
download()Sets the download attribute.HasDownload
public function download(bool|string|Stringable|UnitEnum|null $value): static

Sets the download attribute.

Controls whether the linked resource is treated as a download.

Parameters

ParameterTypeDescription
$valuebool|string|Stringable|UnitEnum|nullDownload flag or suggested filename; use true to enable downloads without a filename, or null to remove the attribute.

Returns

static: New instance with the updated download attribute.

See also