function FileSystemInterface::createFilename
Same name in other branches
- 8.9.x core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::createFilename()
- 10 core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::createFilename()
- 11.x core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::createFilename()
Creates a full file path from a directory and filename.
If a file with the specified name already exists, an alternative will be used.
Parameters
string $basename: The filename.
string $directory: The directory or parent URI.
Return value
string File path consisting of $directory and a unique filename based off of $basename.
Throws
\Drupal\Core\File\Exception\FileException Implementation may throw FileException or its subtype on failure.
1 method overrides FileSystemInterface::createFilename()
- FileSystem::createFilename in core/
lib/ Drupal/ Core/ File/ FileSystem.php - Creates a full file path from a directory and filename.
File
-
core/
lib/ Drupal/ Core/ File/ FileSystemInterface.php, line 427
Class
- FileSystemInterface
- Provides an interface for helpers that operate on files and stream wrappers.
Namespace
Drupal\Core\FileCode
public function createFilename($basename, $directory);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.