You are here

public function Asset::setMimeType in Mini site 8

Set mime type.

Parameters

string $mime_type: The file mime type.

Overrides AssetInterface::setMimeType

1 call to Asset::setMimeType()
Asset::__construct in src/Asset.php
Asset constructor.

File

src/Asset.php, line 421

Class

Asset
Class Asset.

Namespace

Drupal\minisite

Code

public function setMimeType($mime_type) {
  if (!empty($mime_type)) {
    $this->mimeType = $mime_type;
  }
  else {
    $this->mimeType = $this
      ->guessMimeType($this
      ->getUri());
  }
}