Slots

Learn how to reference the content type of a slot.

This interface holds a named content type for each Slot, generated by the CLI in the Croct\Content namespace. Each type is named after its slot in PascalCase, where the bare name resolves to the latest version and a V<major> suffix targets a specific major.

Example

Supposing you have a slot named home-banner with versions 1 and 2, this interface exposes HomeBanner for the latest version (currently version 2), HomeBannerV1 for version 1, and HomeBannerV2 for version 2.

To annotate your own code, import a type with @phpstan-import-type and @psalm-import-type:

<?php/** * @phpstan-import-type HomeBanner from \Croct\Content\Slots * @psalm-import-type HomeBanner from \Croct\Content\Slots */final class HomePage{    /** @var HomeBanner */    public array $banner;}