getVersion

Learn how to read the version the content was resolved from.

This method gives you the version of the slot the content was resolved from.

Signature

This method has the following signature:

public function getVersion(): string

This method returns the version of the slot the content was resolved from.

Example

Here is a basic example of how to use this method:

<?phpuse Croct\Plug\Croct;use Croct\Plug\FetchOptions;
$croct = Croct::fromDotenv();$options = FetchOptions::defaults()->withSchema();$metadata = $croct->fetchContent('home-banner', $options)->getMetadata();$version = $metadata->getVersion();