Extension
Basic extension adding phpDocumentor specific functionality for Twig templates.
Global variables:
- ast_node, the current $data element
Functions:
- path(string) , converts the given relative path to be based of the projects root instead of the current directory
Filters:
- markdown, converts the associated text from Markdown formatting to HTML.
- trans, translates the given string
- route, attempts to generate a URL for a given Descriptor
- sort_desc, sorts the given objects by their Name property/getter in a descending fashion
- sort_asc, sorts the given objects by their Name property/getter in a ascending fashion
Interfaces, Classes & Used Traits
- ExtensionInterface
- An interface shared by all Twig interfaces intended for phpDocumentor.
- GlobalsInterface
Properties
$data Line 56
protected$data : \phpDocumentor\Descriptor\ProjectDescriptor
$routeRenderer Line 59
protected$routeRenderer : \phpDocumentor\Transformer\Writer\Twig\LinkRenderer
Methods
__construct() Line 66
Registers the structure and transformation with this extension.
public__construct(ProjectDescriptor $project[, LinkRenderer|null $routeRenderer = null ]) : mixed
Parameters
Represents the complete Abstract Syntax Tree.
Returns
mixed —
setDestination() Line 83
Sets the destination directory relative to the Project's Root.
publicsetDestination(string $destination) : void
The destination is the target directory containing the resulting file. This destination is relative to the Project's root and can be used for the calculation of nesting depths, etc.
Parameters
getGlobals() Line 93
Returns an array of global variables to inject into a Twig template.
publicgetGlobals() : array
Returns
array —
getFunctions() Line 114
Returns a listing of all functions that this extension adds.
publicgetFunctions() : \Twig\TwigFunction[]
This method is automatically used by Twig upon registering this extension (which is done automatically by phpDocumentor) to determine an additional list of functions.
See the Class' DocBlock for a listing of functionality added by this Extension.
Returns
\Twig\TwigFunction[] —
getFilters() Line 157
Returns a list of all filters that are exposed by this extension.
publicgetFilters() : \Twig\TwigFilter[]