\phpDocumentor\Transformer\Writer\TwigExtension

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

Summary

Methods
Properties
Constants
__construct()
getGlobals()
getFunctions()
getFilters()
renderRoute()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
contextRouteRenderer()
$routeRenderer
$markdownConverter
N/A

Properties

$routeRenderer

$routeRenderer : \phpDocumentor\Transformer\Writer\Twig\LinkRenderer

Type

LinkRenderer

$markdownConverter

$markdownConverter : \League\CommonMark\MarkdownConverterInterface

Type

\League\CommonMark\MarkdownConverterInterface —

Methods

__construct()

__construct(\phpDocumentor\Descriptor\ProjectDescriptor  $project, \League\CommonMark\MarkdownConverterInterface  $markdownConverter, \phpDocumentor\Transformer\Writer\Twig\LinkRenderer  $routeRenderer) : mixed

Registers the structure and transformation with this extension.

Parameters

\phpDocumentor\Descriptor\ProjectDescriptor $project

Represents the complete Abstract Syntax Tree.

\League\CommonMark\MarkdownConverterInterface $markdownConverter
\phpDocumentor\Transformer\Writer\Twig\LinkRenderer $routeRenderer

Returns

mixed —

getGlobals()

getGlobals() : array<string,true|null>

Initialize series of globals used by the writers to set the context

Returns

array

getFunctions()

getFunctions() : \Twig\TwigFunction[]

Returns a listing of all functions that this extension adds.

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()

getFilters() : \Twig\TwigFilter[]

Returns a list of all filters that are exposed by this extension.

Returns

\Twig\TwigFilter[] —

renderRoute()

renderRoute(array  $context, \phpDocumentor\Reflection\Type[]|\phpDocumentor\Reflection\Type|\phpDocumentor\Descriptor\DescriptorAbstract|\phpDocumentor\Reflection\Fqsen|\phpDocumentor\Reflection\DocBlock\Tags\Reference\Reference|\phpDocumentor\Path|string|iterable  $value, string  $presentation) : string[]|string

Parameters

array $context
\phpDocumentor\Reflection\Type[]|\phpDocumentor\Reflection\Type|\phpDocumentor\Descriptor\DescriptorAbstract|\phpDocumentor\Reflection\Fqsen|\phpDocumentor\Reflection\DocBlock\Tags\Reference\Reference|\phpDocumentor\Path|string|iterable $value
string $presentation

Returns

string[]|string —

contextRouteRenderer()

contextRouteRenderer(array  $context) : \phpDocumentor\Transformer\Writer\Twig\LinkRenderer

Parameters

array $context

Returns

\phpDocumentor\Transformer\Writer\Twig\LinkRenderer —