You are here

public function File::url in Drupal 8

Overrides EntityBase::url

See also

file_url_transform_relative()

File

core/modules/file/src/Entity/File.php, line 94

Class

File
Defines the file entity class.

Namespace

Drupal\file\Entity

Code

public function url($rel = 'canonical', $options = []) {
  @trigger_error('File entities returning the URL to the physical file in File::url() is deprecated, use $file->createFileUrl() instead. See https://www.drupal.org/node/3019830', E_USER_DEPRECATED);
  return $this
    ->createFileUrl(FALSE);
}