make()#
Static alias for the constructor.
/** @param string|(Closure(): string)|(Closure(static): string)|null $contents */
InMemoryPage::make(string|(Closure(): string)|(Closure(static):, Hyde\Markdown\Models\FrontMatter|array $matter, Closure|string|null $contents, string $view): static
__construct()#
Create a new in-memory (virtual) page instance.
Pass literal contents or a closure to $contents, or pass a registered Laravel view key or Blade file path to $view.
Contents and views cannot be used together. Omit both to create an empty page. An empty view value is treated as no view.
View values ending in .blade.php are treated as Blade file paths. Other values are treated as registered Laravel view keys.
/** @param string|(Closure(): string)|(Closure(static): string)|null $contents */
$page = new InMemoryPage(string $identifier, FrontMatter|array $matter, string|(Closure(): string)|(Closure(static):, string|null $view): void
- Throws: InvalidArgumentException If both contents and a view are supplied.
getContents()#
Get the literal contents or invoke the configured content closure.
$page->getContents(): string
getBladeView()#
Get the Blade view key or file path, or an empty string when none is configured.
$page->getBladeView(): string
compile()#
Get the contents that will be saved to disk for this page.
$page->compile(): string