Skip to content

Kirby 5.0.4

$file->replace()

Replaces the file. The source must be an absolute path to a file or a Url. The store handles the replacement so it finally decides what it will support as source.

$file->replace(string $source, bool $move = false): Kirby\Cms\File

Parameters

Name Type Default Description
$sourcerequired string no default value
$move bool false If set to true, the source will be deleted

Return type

Kirby\Cms\File

This method does not modify the existing $file object but returns a new object with the changes applied. Learn more →

Exceptions

Parent class

Kirby\Cms\File