Collection
in package
Value object representing a single content-type collection as configured in `guides.xml`.
A collection groups a set of source files (located in getSourceDirectory()) into a list of ContentTypeItemNode instances, and generates a single overview page at getOverviewPath().
Leading slashes are normalised away from both path fields on construction so
that callers never need to call ltrim(…, '/') themselves.
Instances are created by fromArray() from the raw Symfony Config array produced by PagesExtension.
Table of Contents
Properties
- $itemTemplate : string
- $overviewPath : string
- $overviewTemplate : string
- $overviewTitle : string
- $sourceDirectory : string
Methods
- fromArray() : self
- getItemTemplate() : string
- Default Twig template for individual items; may be overridden per item via `:page-template:`.
- getOverviewPath() : string
- Output path for the generated overview page, without the `.html` extension.
- getOverviewTemplate() : string
- Twig template used to render the overview page.
- getOverviewTitle() : string
- Title displayed on the overview page.
- getSourceDirectory() : string
- Path (relative to the docs source root) containing the collection's source files.
- __construct() : mixed
Properties
$itemTemplate read-only
private
string
$itemTemplate
$overviewPath read-only
private
string
$overviewPath
$overviewTemplate read-only
private
string
$overviewTemplate
$overviewTitle read-only
private
string
$overviewTitle
$sourceDirectory read-only
private
string
$sourceDirectory
Methods
fromArray()
public
static fromArray(array{source_directory: string, overview_path: string, overview_title: string, overview_template: string, item_template: string} $data) : self
Parameters
- $data : array{source_directory: string, overview_path: string, overview_title: string, overview_template: string, item_template: string}
Return values
selfgetItemTemplate()
Default Twig template for individual items; may be overridden per item via `:page-template:`.
public
getItemTemplate() : string
Return values
stringgetOverviewPath()
Output path for the generated overview page, without the `.html` extension.
public
getOverviewPath() : string
Return values
stringgetOverviewTemplate()
Twig template used to render the overview page.
public
getOverviewTemplate() : string
Return values
stringgetOverviewTitle()
Title displayed on the overview page.
public
getOverviewTitle() : string
Return values
stringgetSourceDirectory()
Path (relative to the docs source root) containing the collection's source files.
public
getSourceDirectory() : string
Return values
string__construct()
private
__construct(string $sourceDirectory, string $overviewPath, string $overviewTitle, string $overviewTemplate, string $itemTemplate) : mixed
Parameters
- $sourceDirectory : string
- $overviewPath : string
- $overviewTitle : string
- $overviewTemplate : string
- $itemTemplate : string