AssetsExtension
extends AbstractExtension
in package
Table of Contents
Properties
- $documentNameResolver : DocumentNameResolverInterface
- $logger : LoggerInterface
- $menuExtension : GlobalMenuExtension
- $nodeRenderer : NodeRenderer
- $urlGenerator : UrlGeneratorInterface
Methods
- __construct() : mixed
- asset() : string
- Copies the referenced asset and returns the canonical path to that asset; thus taking the BASE tag into account.
- getExpressionParsers() : array<string|int, mixed>
- getFilters() : array<string|int, TwigFilter>
- Returns a list of filters to add to the existing list.
- getFunctions() : array<string|int, TwigFunction>
- Returns a list of functions to add to the existing list.
- getLastModified() : int
- Returns the last modification time of the extension for cache invalidation.
- 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.
- renderBreadcrumb() : string
- renderLink() : string
- renderMenu() : string
- renderNode() : string
- renderOrderedListType() : string
- renderTarget() : string
- copyAsset() : string
- getRenderContext() : RenderContext
Properties
$documentNameResolver read-only
private
DocumentNameResolverInterface
$documentNameResolver
$logger read-only
private
LoggerInterface
$logger
$menuExtension
private
GlobalMenuExtension
$menuExtension
$nodeRenderer read-only
private
NodeRenderer
$nodeRenderer
$urlGenerator read-only
private
UrlGeneratorInterface
$urlGenerator
Methods
__construct()
public
__construct(LoggerInterface $logger, NodeRenderer<string|int, Node> $nodeRenderer, DocumentNameResolverInterface $documentNameResolver, UrlGeneratorInterface $urlGenerator) : mixed
Parameters
- $logger : LoggerInterface
- $nodeRenderer : NodeRenderer<string|int, Node>
- $documentNameResolver : DocumentNameResolverInterface
- $urlGenerator : UrlGeneratorInterface
asset()
Copies the referenced asset and returns the canonical path to that asset; thus taking the BASE tag into account.
public
asset(RenderContext} $context, string $path) : string
The layout for guides includes a BASE tag in the head, which creates the need for all relative urls to actually be relative not to the current file's path; but the root of the Documentation Set. This means that, when rendering paths, you always need to include the canonical path; not that relative to the current file.
Parameters
- $context : RenderContext}
- $path : string
Return values
stringgetExpressionParsers()
public
getExpressionParsers() : array<string|int, mixed>
Return values
array<string|int, mixed>getFilters()
Returns a list of filters to add to the existing list.
public
getFilters() : array<string|int, TwigFilter>
Return values
array<string|int, TwigFilter>getFunctions()
Returns a list of functions to add to the existing list.
public
getFunctions() : array<string|int, TwigFunction>
Return values
array<string|int, TwigFunction>getLastModified()
Returns the last modification time of the extension for cache invalidation.
public
getLastModified() : int
This timestamp should be the last time the source code of the extension class and all its dependencies were modified (including the Runtime class).
Return values
intgetNodeVisitors()
Returns the node visitor instances to add to the existing list.
public
getNodeVisitors() : array<string|int, NodeVisitorInterface>
Return values
array<string|int, NodeVisitorInterface>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>>getTests()
Returns a list of tests to add to the existing list.
public
getTests() : array<string|int, TwigTest>
Return values
array<string|int, TwigTest>getTokenParsers()
Returns the token parser instances to add to the existing list.
public
getTokenParsers() : array<string|int, TokenParserInterface>
Return values
array<string|int, TokenParserInterface>renderBreadcrumb()
public
renderBreadcrumb(RenderContext} $context) : string
Parameters
- $context : RenderContext}
Return values
stringrenderLink()
public
renderLink(RenderContext} $context, string $url[, string|null $anchor = null ]) : string
Parameters
- $context : RenderContext}
- $url : string
- $anchor : string|null = null
Return values
stringrenderMenu()
public
renderMenu(RenderContext} $context, string $menuType[, int $maxMenuCount = 0 ]) : string
Parameters
- $context : RenderContext}
- $menuType : string
- $maxMenuCount : int = 0
Return values
stringrenderNode()
public
renderNode(RenderContext} $context, Node|array<string|int, Node>|null $node) : string
Parameters
Return values
stringrenderOrderedListType()
public
renderOrderedListType(string $listType) : string
Parameters
- $listType : string
Return values
stringrenderTarget()
public
renderTarget(RenderContext} $context, Target $target) : string
Parameters
- $context : RenderContext}
- $target : Target
Return values
stringcopyAsset()
private
copyAsset(RenderContext|null $renderContext, string $sourcePath) : string
Parameters
- $renderContext : RenderContext|null
- $sourcePath : string
Return values
stringgetRenderContext()
private
getRenderContext(RenderContext} $context) : RenderContext
Parameters
- $context : RenderContext}