\phpDocumentor\Transformer\TemplateFactory

Summary

Methods
Properties
Constants
__construct()
get()
getAllNames()
getTemplatePath()
No public properties found
TEMPLATE_DEFINITION_FILENAME
fetchTemplateXmlFromPath()
createTemplateFromXml()
No protected properties found
N/A
No private methods found
$serializer
$pathResolver
N/A

Constants

TEMPLATE_DEFINITION_FILENAME

TEMPLATE_DEFINITION_FILENAME = 'template.xml'

Properties

$serializer

$serializer : \JMS\Serializer\Serializer

Type

\JMS\Serializer\Serializer

Methods

__construct()

__construct(\phpDocumentor\Transformer\Template\PathResolver  $pathResolver, \JMS\Serializer\Serializer  $serializer) 

Constructs a new template factory with its dependencies.

Parameters

\phpDocumentor\Transformer\Template\PathResolver $pathResolver
\JMS\Serializer\Serializer $serializer

Serializer used to convert the XML files to models.

get()

get(string  $nameOrPath) : \phpDocumentor\Transformer\Template

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

Parameters

string $nameOrPath

Returns

\phpDocumentor\Transformer\Template

getAllNames()

getAllNames() : array<mixed,string>

Returns a list of all template names.

Returns

array<mixed,string>

getTemplatePath()

getTemplatePath() : string

Returns the path where all templates are stored.

Returns

string

fetchTemplateXmlFromPath()

fetchTemplateXmlFromPath(string  $path) : string

Loads the template definition file from the given path and returns it's contents.

Parameters

string $path

Returns

string

createTemplateFromXml()

createTemplateFromXml(string  $xml) : \phpDocumentor\Transformer\Template

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

Parameters

string $xml

Returns

\phpDocumentor\Transformer\Template