Documentation

Factory
in package

Table of Contents

TEMPLATE_DEFINITION_FILENAME  = 'template.xml'
$flySystemFactory  : FlySystemFactory
$globalTemplatesPath  : string
$writerCollection  : Collection
__construct()  : mixed
Constructs a new template factory with its dependencies.
getAllNames()  : array<string|int, string>
Returns a list of all template names.
getTemplates()  : Collection
Attempts to find, construct and return a template object with the given template name or (relative/absolute) path.
getTemplatesPath()  : string
Returns the path where all templates are stored.
createNewFilesystemFromSubfolder()  : Filesystem
createTemplateFromXml()  : Template
Creates and returns a template object based on the provided template definition.
getTemplatesDirectory()  : Filesystem
loadTemplate()  : Template
resolve()  : FilesystemInterface

Constants

TEMPLATE_DEFINITION_FILENAME

public mixed TEMPLATE_DEFINITION_FILENAME = 'template.xml'

Properties

$globalTemplatesPath

private string $globalTemplatesPath

Methods

__construct()

Constructs a new template factory with its dependencies.

public __construct(Collection $writerCollection, FlySystemFactory $flySystemFactory, string $globalTemplatesPath) : mixed
Parameters
$writerCollection : Collection
$flySystemFactory : FlySystemFactory
$globalTemplatesPath : string
Return values
mixed

getAllNames()

Returns a list of all template names.

public getAllNames() : array<string|int, string>
Return values
array<string|int, string>

getTemplates()

Attempts to find, construct and return a template object with the given template name or (relative/absolute) path.

public getTemplates(array<int, array{name: string, parameters: array}> $templates, FilesystemInterface $output) : Collection
Parameters
$templates : array<int, array{name: string, parameters: array}>
$output : FilesystemInterface
Return values
Collection

getTemplatesPath()

Returns the path where all templates are stored.

public getTemplatesPath() : string
Return values
string

createTemplateFromXml()

Creates and returns a template object based on the provided template definition.

private createTemplateFromXml(FilesystemInterface $filesystem, string $nameOrPath, array<string, string> $templateParams) : Template
Parameters
$filesystem : FilesystemInterface
$nameOrPath : string
$templateParams : array<string, string>
Return values
Template

Search results