BumbleDocGen / Technical description of the project / Renderer / Template functions / GetDocumentedEntityUrl
GetDocumentedEntityUrl class:
namespace BumbleDocGen\Core\Renderer\Twig\Function;
final class GetDocumentedEntityUrl implements \BumbleDocGen\Core\Renderer\Twig\Function\CustomFunctionInterfaceGet 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:
- \BumbleDocGen\Core\Renderer\Context\DocumentedEntityWrapper
- \BumbleDocGen\Core\Renderer\Context\DocumentedEntityWrappersCollection
- \BumbleDocGen\Core\Renderer\Context\RendererContext::$entityWrappersCollection
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| Function name: | getDocumentedEntityUrl |
- #
DEFAULT_URL| source code
- # __construct | source code
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 | - |
- # __invoke | source code
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:
- # getName | source code
public static function getName(): string;Parameters: not specified
Return value: string
- # getOptions | source code
public static function getOptions(): array;Parameters: not specified
Return value: array