function File::url

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.