phpDocumentor

Factory
in package

Table of Contents

Constants

TEMPLATE_DEFINITION_FILENAME  = 'template.xml'

Properties

$flySystemFactory  : FlySystemFactory
$globalTemplatesPath  : string
$writerCollection  : Collection

Methods

__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 final mixed TEMPLATE_DEFINITION_FILENAME = 'template.xml'

Properties

$globalTemplatesPath read-only

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

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, Path, parameters: array}$templates, FilesystemInterface $output) : Collection
Parameters
$templates : array<int, Path, parameters: array}>
$output : FilesystemInterface
Return values
Collection

getTemplatesPath()

Returns the path where all templates are stored.

public getTemplatesPath() : string
Return values
string

createNewFilesystemFromSubfolder()

private createNewFilesystemFromSubfolder(Filesystem $hostFilesystem, string $subfolder) : Filesystem
Parameters
$hostFilesystem : Filesystem
$subfolder : string
Return values
Filesystem

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

getTemplatesDirectory()

private getTemplatesDirectory() : Filesystem
Return values
Filesystem

loadTemplate()

private loadTemplate(FilesystemInterface $output, string $template, array<string, string> $parameters) : Template
Parameters
$output : FilesystemInterface
$template : string
$parameters : array<string, string>
Return values
Template

resolve()

private resolve(string $nameOrPath) : FilesystemInterface
Parameters
$nameOrPath : string
Return values
FilesystemInterface

        
On this page

Search results