Renderer

Renders an HTML anchor pointing to the location of the provided element.

package

Default

Methods

Initializes this renderer with a set of routers that are checked.

__construct(\phpDocumentor\Transformer\Router\Queue $routers) 

Converts the given path to be relative to the root of the documentation target directory.

convertToRootPath(string $relative_path) : string

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.

Arguments

$relative_path

string

Response

string

Returns the target directory relative to the Project's Root.

getDestination() : string

Response

string

Returns the routers used in generating the URLs for the anchors.

getRouters() : \phpDocumentor\Transformer\Router\Queue

render

render(string|\phpDocumentor\Descriptor\DescriptorAbstract $value, string $presentation) : boolean|mixed|string|array<mixed,\string>

Arguments

$presentation

string

Response

boolean|mixed|string|array<mixed,\string>

Renders the view representation for an array or collection.

renderTypeCollection(\phpDocumentor\Descriptor\Type\CollectionDescriptor $value, string $presentation) : string

Arguments

$presentation

string

Response

string

Sets the destination directory relative to the Project's Root.

setDestination(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.

For this specific extension the destination is provided in the Twig writer itself.

see \phpDocumentor\Transformer\Router\phpDocumentor\Plugin\Twig\Transformer\Writer\Twig

for the invocation of this method.

Arguments

$destination

string

Overwrites the associated routers with a new set of routers.

setRouters(\phpDocumentor\Transformer\Router\Queue $routers) : void

Properties

destination

destination : string
var

Type(s)

string

routers

routers : \phpDocumentor\Transformer\Router\Queue