ProvideTemplateOverridePathMiddleware
in package
implements
MiddlewareInterface
FinalYes
Determines the path where the general template overrides are.
Since phpDocumentor 3, we now have the feature that in the subfolder '.phpdoc/template' relative to where your configuration file resides you can add twig templates with the same name as those used in a template. When you do this, that file will be used instead of the one in the template, and you can customize rendering this way.
This configuration middleware is responsible for finding the path where these overrides are, and adding this to the Twig Environment Factory so that it can be added as a template source once the Twig Environment is created.
Table of Contents
Interfaces
Constants
- PATH_TO_TEMPLATE_OVERRIDES = '.phpdoc/template'
Properties
Methods
- __construct() : mixed
- __invoke() : Configuration
- normalizePath() : Path
Constants
PATH_TO_TEMPLATE_OVERRIDES
public
mixed
PATH_TO_TEMPLATE_OVERRIDES
= '.phpdoc/template'
Properties
$environmentFactory read-only
private
EnvironmentFactory
$environmentFactory
Methods
__construct()
public
__construct(EnvironmentFactory $environmentFactory) : mixed
Parameters
- $environmentFactory : EnvironmentFactory
__invoke()
public
__invoke(Configuration $configuration[, UriInterface|null $pathOfConfigFile = null ]) : Configuration
Parameters
- $configuration : Configuration
- $pathOfConfigFile : UriInterface|null = null
Return values
ConfigurationnormalizePath()
private
normalizePath(UriInterface|null $uri, Path $path) : Path
Parameters
- $uri : UriInterface|null
- $path : Path