Skip to content

Kirby 3.8.3


Renames the file without touching the extension The store is used to actually execute this.

$file->changeName(string $name, bool $sanitize = true): Kirby\Cms\File


Name Type Default
$name * string
$sanitize bool true

Return type


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


Parent class



Kirby's objects are immutable. That means, when you modify an object like $page, $file etc. using a method like update(), changeTitle() and so on, a new object is returned. Therefore, you have to store the returned object in a new variable to be able to further work with it.