\phpDocumentor\Transformer\RouterRenderer

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

Summary

Methods
Properties
Constants
__construct()
setRouters()
getRouters()
setDestination()
getDestination()
render()
convertToRootPath()
No public properties found
No constants found
renderASeriesOfLinks()
renderTypeCollection()
renderLink()
$destination
N/A
No private methods found
$routers
N/A

Properties

$destination

$destination : string

Type

string

Methods

__construct()

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

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

Parameters

\phpDocumentor\Transformer\Router\Queue $routers

setRouters()

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

Overwrites the associated routers with a new set of routers.

Parameters

\phpDocumentor\Transformer\Router\Queue $routers

setDestination()

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.

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

Parameters

string $destination

getDestination()

getDestination() : string

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

Returns

string

render()

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

Parameters

string|\phpDocumentor\Descriptor\DescriptorAbstract $value
string $presentation

Returns

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

convertToRootPath()

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.

Parameters

string $relative_path

Returns

string

renderASeriesOfLinks()

renderASeriesOfLinks(array|\Traversable|\phpDocumentor\Descriptor\Collection  $value, string  $presentation) : array<mixed,string>

Returns a series of anchors and strings for the given collection of routable items.

Parameters

array|\Traversable|\phpDocumentor\Descriptor\Collection $value
string $presentation

Returns

array<mixed,string>

renderTypeCollection()

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

Renders the view representation for an array or collection.

Parameters

\phpDocumentor\Descriptor\Type\CollectionDescriptor $value
string $presentation

Returns

string

renderLink()

renderLink(  $path,   $presentation) 

Parameters

$path
$presentation