You are here

function drupal_basename in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/includes/file.inc \drupal_basename()

Gets the filename from a given path.

Deprecated

in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystem::basename().

Related topics

32 calls to drupal_basename()
color_library_info_alter in core/modules/color/color.module
Implements hook_library_info_alter().
color_scheme_form_submit in core/modules/color/color.module
Form submission handler for color_scheme_form().
EditorFileUsageTest::testEditorEntityHooks in core/modules/editor/src/Tests/EditorFileUsageTest.php
Tests the configurable text editor manager.
ExtensionMimeTypeGuesser::guess in core/lib/Drupal/Core/File/MimeType/ExtensionMimeTypeGuesser.php
Guesses the mime type of the file with the given path.
File::preCreate in core/modules/file/src/Entity/File.php
Changes the values of an entity before it is created.

... See full list

File

core/includes/file.inc, line 1064
API for handling file uploads and server file management.

Code

function drupal_basename($uri, $suffix = NULL) {
  return \Drupal::service('file_system')
    ->basename($uri, $suffix);
}