Documentation

Extension extends AbstractExtension
in package
implements ExtensionInterface, GlobalsInterface

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 and Traits

ExtensionInterface
An interface shared by all Twig interfaces intended for phpDocumentor.
GlobalsInterface
Enables usage of the deprecated Twig\Extension\AbstractExtension::getGlobals() method.

Table of Contents

$markdownConverter  : MarkdownConverterInterface
$routeRenderer  : LinkRenderer
__construct()  : mixed
Registers the structure and transformation with this extension.
getFilters()  : array<string|int, TwigFilter>
Returns a list of all filters that are exposed by this extension.
getFunctions()  : array<string|int, TwigFunction>
Returns a listing of all functions that this extension adds.
getGlobals()  : array<string, true|null>
Initialize series of globals used by the writers to set the context
getNodeVisitors()  : array<string|int, NodeVisitorInterface>
Returns the node visitor instances to add to the existing list.
getOperators()  : array<string|int, array<string|int, mixed>>
Returns a list of operators to add to the existing list.
getTests()  : array<string|int, TwigTest>
Returns a list of tests to add to the existing list.
getTokenParsers()  : array<string|int, TokenParserInterface>
Returns the token parser instances to add to the existing list.
renderRoute()  : array<string|int, string>|string
contextRouteRenderer()  : LinkRenderer

Properties

Methods

getFilters()

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

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

getFunctions()

Returns a listing of all functions that this extension adds.

public getFunctions() : array<string|int, 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.

Return values
array<string|int, TwigFunction>

getGlobals()

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

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

getOperators()

Returns a list of operators to add to the existing list.

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

First array of unary operators, second array of binary operators

getTests()

Returns a list of tests to add to the existing list.

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

contextRouteRenderer()

private contextRouteRenderer(array<string|int, mixed> $context) : LinkRenderer
Parameters
$context : array<string|int, mixed>
Return values
LinkRenderer

Search results