Guides

PagesRegistry
in package

FinalYes

Shared state carrier between the parse and render event listeners.

Stores two separate collections:

RenderPagesListener reads both collections back during the post-render phase via getAllRenderables() to write the final HTML output.

This service must be registered as a shared singleton in the DI container so that all listeners operate on the same instance.

Table of Contents

Properties

$collectionItems  : array<string, array<string|int, ContentTypeItemNode>>
Content-type items grouped by collection key (source_directory).
$overviews  : array<string, ContentTypeOverviewNode>
Overview nodes keyed by outputPath.
$pages  : array<string|int, PageNode>

Methods

addCollectionItem()  : void
addOverview()  : void
addPage()  : void
getAllRenderables()  : array<string|int, RenderablePageInterface>
Returns all static pages **and** all content-type items as a flat list of {@see RenderablePageInterface} instances.
getCollectionItems()  : array<string|int, ContentTypeItemNode>
Returns all items for a collection in their original (parse) order.
getPages()  : array<string|int, PageNode>
getSortedCollectionItems()  : array<string|int, ContentTypeItemNode>
Returns all items for a collection sorted **newest-first** by publication date. Items without a date sort after all dated items, preserving their relative parse order among themselves.
updateCollectionItems()  : void
updatePages()  : void

Properties

$collectionItems

Content-type items grouped by collection key (source_directory).

private array<string, array<string|int, ContentTypeItemNode>> $collectionItems = []

Methods

getCollectionItems()

Returns all items for a collection in their original (parse) order.

public getCollectionItems(string $collectionKey) : array<string|int, ContentTypeItemNode>
Parameters
$collectionKey : string
Return values
array<string|int, ContentTypeItemNode>

getSortedCollectionItems()

Returns all items for a collection sorted **newest-first** by publication date. Items without a date sort after all dated items, preserving their relative parse order among themselves.

public getSortedCollectionItems(string $collectionKey) : array<string|int, ContentTypeItemNode>
Parameters
$collectionKey : string
Return values
array<string|int, ContentTypeItemNode>

updateCollectionItems()

public updateCollectionItems(string $collectionKey, array<string|int, DocumentNode$documents) : void
Parameters
$collectionKey : string
$documents : array<string|int, DocumentNode>
On this page

Search results