Skip to content

Latest commit

 

History

History
269 lines (192 loc) · 8.14 KB

File metadata and controls

269 lines (192 loc) · 8.14 KB

BumbleDocGen / Technical description of the project / Renderer / Template functions / GetDocumentedEntityUrl


namespace BumbleDocGen\Core\Renderer\Twig\Function;

final class GetDocumentedEntityUrl implements \BumbleDocGen\Core\Renderer\Twig\Function\CustomFunctionInterface
Get the URL of a documented entity by its name. If the entity is found, next to the file where this method was called, the `EntityDocRendererInterface::getDocFileExtension()` directory will be created, in which the documented entity file will be created

See:

Examples of using:

{{ getDocumentedEntityUrl(phpClassEntityCollection, '\\BumbleDocGen\\Renderer\\Twig\\MainExtension', 'getFunctions') }}
The function returns a reference to the documented entity, anchored to the getFunctions method
{{ getDocumentedEntityUrl(phpClassEntityCollection, '\\BumbleDocGen\\Renderer\\Twig\\MainExtension') }}
The function returns a reference to the documented entity MainExtension
{{ getDocumentedEntityUrl(phpClassEntityCollection, '\\BumbleDocGen\\Renderer\\Twig\\MainExtension', '', false) }}
The function returns a link to the file MainExtension

Settings:

Function name: getDocumentedEntityUrl

Initialization methods:

  1. __construct

Methods:

  1. __invoke
  2. getName
  3. getOptions

Constants:

Method details:

public function __construct(\BumbleDocGen\Core\Renderer\RendererHelper $rendererHelper, \BumbleDocGen\Core\Renderer\Context\DocumentedEntityWrappersCollection $documentedEntityWrappersCollection, \BumbleDocGen\Core\Configuration\Configuration $configuration, \Monolog\Logger $logger);

Parameters:

Name Type Description
$rendererHelper \BumbleDocGen\Core\Renderer\RendererHelper -
$documentedEntityWrappersCollection \BumbleDocGen\Core\Renderer\Context\DocumentedEntityWrappersCollection -
$configuration \BumbleDocGen\Core\Configuration\Configuration -
$logger \Monolog\Logger -

public function __invoke(\BumbleDocGen\Core\Parser\Entity\RootEntityCollection $rootEntityCollection, string $entityName, string $cursor = '', bool $createDocument = true): string;

Parameters:

Name Type Description
$rootEntityCollection \BumbleDocGen\Core\Parser\Entity\RootEntityCollection Processed entity collection
$entityName string The full name of the entity for which the URL will be retrieved. If the entity is not found, the DEFAULT_URL value will be returned.
$cursor string Cursor on the page of the documented entity (for example, the name of a method or property)
$createDocument bool If true, creates an entity document. Otherwise, just gives a reference to the entity code

Return value: string

Throws:


public static function getName(): string;

Parameters: not specified

Return value: string


public static function getOptions(): array;

Parameters: not specified

Return value: array