$data
$data : \phpDocumentor\Descriptor\ProjectDescriptor
Basic extension adding phpDocumentor specific functionality for Twig templates.
Global variables:
Functions:
Filters:
$data : \phpDocumentor\Descriptor\ProjectDescriptor
$translator : \phpDocumentor\Translator\Translator
$routeRenderer : \phpDocumentor\Transformer\Router\Renderer
__construct(\phpDocumentor\Descriptor\ProjectDescriptor $project, \phpDocumentor\Transformer\Transformation $transformation)
Registers the structure and transformation with this extension.
The Structure and Transformation object can be used to get context from and to provide additional information.
\phpDocumentor\Descriptor\ProjectDescriptor | $project | Represents the complete Abstract Syntax Tree. |
\phpDocumentor\Transformer\Transformation | $transformation | Represents the transformation meta data used in the current generation cycle. |
setRouters(\phpDocumentor\Transformer\Router\Queue $routers) : void
Sets the router used to render the URL where a Descriptor can be found.
\phpDocumentor\Transformer\Router\Queue | $routers |
setTranslator(\phpDocumentor\Translator\Translator $translator) : void
Sets the translation component.
\phpDocumentor\Translator\Translator | $translator |
setDestination(string $destination) : void
Sets the destination directory relative to the Project's Root.
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.
string | $destination |
getFunctions() : array<mixed,\Twig_FunctionInterface>
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.
convertToRootPath(string $relative_path) : string
Converts the given path to be relative to the root of the documentation target directory.
It is not possible to use absolute paths in documentation templates since they may be used locally, or in a subfolder. As such we need to calculate the number of levels to go up from the current document's directory and then append the given path.
For example:
Suppose you are in <root>/classes/my/class.html and you want open
<root>/my/index.html then you provide 'my/index.html' to this method
and it will convert it into ../../my/index.html (<root>/classes/my is
two nesting levels until the root).
This method does not try to normalize or optimize the paths in order to save on development time and performance, and because it adds no real value.
string | $relative_path |