Skip to content

Kirby 5.0.1

$file->version()

Returns a content version instance

$file->version(Kirby\Content\VersionId|string|null $versionId = null): Kirby\Content\Version

Parameters

Name Type Default
$versionId Kirby\Content\VersionIdorstringornull null

Return type

Kirby\Content\Version

Parent class

Kirby\Cms\File inherited from Kirby\Cms\ModelWithContent

Examples

// get the latest saved content of a file
$file->version('latest');

// get all unsaved changes
$file->version('changes');