ElementsCMSItem.php
Represents a single CMS item loaded from a Markdown file with front matter. Provides structured access to metadata, raw and rendered content, file paths, and relationships to other items.
Constructor
__construct(ElementsCMS $cms, array $data = [])
__construct(ElementsCMS $cms, array $data = [])Static Methods
static load(ElementsCMS $cms, string $filepath): ?self
static load(ElementsCMS $cms, string $filepath): ?selfInstance Methods
setOptions(array $options): self
setOptions(array $options): selfgetOption(string $key, $default = null)
getOption(string $key, $default = null)slug(): string
slug(): stringtitle(): string
title(): stringdate(string $format = 'F j, Y'): string
date(string $format = 'F j, Y'): stringdatePublished(string $format = 'F j, Y'): string
datePublished(string $format = 'F j, Y'): stringdateModified(string $format = 'F j, Y'): string
dateModified(string $format = 'F j, Y'): stringfeatured(): bool
featured(): boolstatus(): string
status(): stringbody(): string
body(): stringrawBody(): string
rawBody(): stringimage(): ?string
image(): ?stringexcerpt(int $words = 30): string
excerpt(int $words = 30): stringmeta(string $key, $default = null): mixed
meta(string $key, $default = null): mixedattach(string $key, $value): self
attach(string $key, $value): selfget(string $key, $default = null): mixed
get(string $key, $default = null): mixed__call($method, $arguments)
__call($method, $arguments)file(): string
file(): stringfileName(): string
fileName(): stringurl(): string
url(): stringlastModified(string $format = 'F j, Y'): string
lastModified(string $format = 'F j, Y'): stringtoArray(): array
toArray(): arraywith(string ...$relations): self
with(string ...$relations): selfwithOne(string ...$relations): self
withOne(string ...$relations): selfwithMany(string ...$relations): self
withMany(string ...$relations): selfloadRelations(): self
loadRelations(): selfUsage Example
Last updated
Was this helpful?

