Skip to content

Kirby 5.1.1

$site->version()

Returns a content version instance

$site->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

This method modifies the existing $site object it is applied to and returns it again.

Parent class

Kirby\Cms\Site inherited from Kirby\Cms\ModelWithContent

Examples

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

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