Cecil

VirtualPages extends AbstractGenerator implements GeneratorInterface

VirtualPages class.

This class is responsible for generating virtual pages based on the configuration provided. It extends the AbstractGenerator and implements the GeneratorInterface. It collects pages from the configuration under the 'pages.virtual' key and creates Page objects for each virtual page defined in the configuration. Each page can have its own frontmatter, and the generator ensures that the pages are created with the correct path and language settings. If a page is marked as unpublished or does not have a path defined, it will be skipped. If a page already exists with the same ID, it will also be skipped. The generated pages are added to the collection of generated pages for further processing.

Table of Contents

Interfaces

GeneratorInterface
Generator interface.

Properties

$builder  : Builder
$config  : Config
$configKey  : mixed
$generatedPages  : Collection

Methods

__construct()  : mixed
Gives the Builder to the object.
generate()  : void
Creates pages and adds it to collection.
runGenerate()  : Collection
Run the `generate` method of the generator and returns pages.
collectPagesFromConfig()  : array<string|int, mixed>|null
Collects virtual pages configuration.

Properties

Methods

generate()

Creates pages and adds it to collection.

public generate() : void

collectPagesFromConfig()

Collects virtual pages configuration.

private collectPagesFromConfig(string $configKey) : array<string|int, mixed>|null
Parameters
$configKey : string
Return values
array<string|int, mixed>|null
 
On this page

Search results