ExtbasePluginEnhancer extends PluginEnhancer
Allows to have a plugin with multiple controllers + actions for one specific plugin that has a namespace.
A typical configuration looks like this:
routeEnhancers: BlogExample: type: Extbase extension: BlogExample plugin: Pi1 routes: - { routePath: '/blog/{page}', _controller: 'Blog::list', _arguments: {'page': '@widget_0/currentPage'} } - { routePath: '/blog/{slug}', _controller: 'Blog::detail' } requirements: page: '[0-9]+' slug: '.*'
Table of Contents
Properties
- $aspects : AspectInterface[]
- $configuration : array
- $namespace : string
- $routesOfPlugin : array
- $variableProcessor : VariableProcessor|null
Methods
- __construct() : mixed
- buildResult() : PageArguments
- enhanceForGeneration() : void
- Extends route collection with routes that are relevant for given parameters. Used during URL generation.
- enhanceForMatching() : void
- Extends route collection with all routes. Used during URL resolving.
- getAspects() : AspectInterface[]
- inflateParameters() : array
- A route has matched the controller/action combination, so ensure that these properties are set to tx_blogexample_pi1[controller] and tx_blogexample_pi1[action].
- setAspects() : void
- applyControllerActionValues() : mixed
- Add controller and action parameters so they can be used later-on.
- applyRequirements() : mixed
- applyRouteAspects() : mixed
- defineValuesByAspect() : array
- Define items having an aspect definition in case they are not defined with a given $targetValue in target $targetValue array.
- deflateParameters() : array
- filterValuesByPathVariables() : array
- Only keeps values that actually have been used as variables in route path.
- getVariableProcessor() : VariableProcessor
- getVariant() : Route
- Builds a variant of a route based on the given configuration.
- hasControllerActionValues() : bool
- Check if action and controller are not empty.
- modifyRoutePath() : string
- Modify the route path to add the variable names with the aspects, e.g.
- overrideValuesByAspect() : array
- Overrides items having an aspect definition with a given $overrideValue in target $targetValue array.
- resolveType() : string
- Retrieves type from processed route and modifies remaining query parameters.
- verifyRequiredParameters() : bool
- Check if controller+action combination matches
Properties
$aspects
protected
AspectInterface[]
$aspects
= []
$configuration
protected
array
$configuration
$namespace
protected
string
$namespace
$routesOfPlugin
protected
array
$routesOfPlugin
$variableProcessor
protected
VariableProcessor|null
$variableProcessor
Methods
__construct()
public
__construct(array $configuration) : mixed
Parameters
- $configuration : array
buildResult()
public
buildResult(Route $route, array $results[, array $remainingQueryParameters = [] ]) : PageArguments
Parameters
- $route : Route
- $results : array
- $remainingQueryParameters : array = []
Return values
PageArgumentsenhanceForGeneration()
Extends route collection with routes that are relevant for given parameters. Used during URL generation.
public
enhanceForGeneration(RouteCollection $collection, array $originalParameters) : void
Parameters
- $collection : RouteCollection
- $originalParameters : array
enhanceForMatching()
Extends route collection with all routes. Used during URL resolving.
public
enhanceForMatching(RouteCollection $collection) : void
Parameters
- $collection : RouteCollection
getAspects()
public
getAspects() : AspectInterface[]
Return values
AspectInterface[]inflateParameters()
A route has matched the controller/action combination, so ensure that these properties are set to tx_blogexample_pi1[controller] and tx_blogexample_pi1[action].
public
inflateParameters(array $parameters[, array $internals = [] ]) : array
Parameters
- $parameters : array
-
Actual parameter payload to be used
- $internals : array = []
-
Internal instructions (_route, _controller, ...)
Return values
arraysetAspects()
public
setAspects(array $aspects) : void
Parameters
- $aspects : array
applyControllerActionValues()
Add controller and action parameters so they can be used later-on.
protected
applyControllerActionValues(string $controllerActionValue, array &$target[, bool $tryUpdate = false ]) : mixed
Parameters
- $controllerActionValue : string
- $target : array
-
Reference to target array to be modified
- $tryUpdate : bool = false
-
Try updating action value - but only if controller value matches
applyRequirements()
protected
applyRequirements(Route $route, array $requirements[, string|null $namespace = null ]) : mixed
Parameters
- $route : Route
- $requirements : array
- $namespace : string|null = null
applyRouteAspects()
protected
applyRouteAspects(Route $route, AspectInterface[] $aspects[, string|null $namespace = null ]) : mixed
Parameters
- $route : Route
- $aspects : AspectInterface[]
- $namespace : string|null = null
defineValuesByAspect()
Define items having an aspect definition in case they are not defined with a given $targetValue in target $targetValue array.
protected
defineValuesByAspect(Route $route, array $values, string $targetValue) : array
Parameters
- $route : Route
- $values : array
- $targetValue : string
Return values
arraydeflateParameters()
protected
deflateParameters(Route $route, array $parameters) : array
Parameters
- $route : Route
- $parameters : array
Return values
arrayfilterValuesByPathVariables()
Only keeps values that actually have been used as variables in route path.
protected
filterValuesByPathVariables(Route $route, array $values) : array
- routePath: '/list/{page}' ('page' used as variable in route path)
- values: ['entity' => 'entity...', 'page' => 'page...', 'other' => 'other...']
- result: ['page' => 'page...']
Parameters
- $route : Route
- $values : array
Return values
arraygetVariableProcessor()
protected
getVariableProcessor() : VariableProcessor
Return values
VariableProcessorgetVariant()
Builds a variant of a route based on the given configuration.
protected
getVariant(Route $defaultPageRoute, array $configuration) : Route
Parameters
- $defaultPageRoute : Route
- $configuration : array
Return values
RoutehasControllerActionValues()
Check if action and controller are not empty.
protected
hasControllerActionValues(array $target) : bool
Parameters
- $target : array
Return values
boolmodifyRoutePath()
Modify the route path to add the variable names with the aspects, e.g.
protected
modifyRoutePath(string $routePath) : string
/{locale_modifier}/{product_title}->/products/{product_title}/{!locale_modifier}/{product_title}->/products/{product_title}
Parameters
- $routePath : string
Return values
stringoverrideValuesByAspect()
Overrides items having an aspect definition with a given $overrideValue in target $targetValue array.
protected
overrideValuesByAspect(Route $route, array $values, string $targetValue) : array
Parameters
- $route : Route
- $values : array
- $targetValue : string
Return values
arrayresolveType()
Retrieves type from processed route and modifies remaining query parameters.
protected
resolveType(Route $route, array &$remainingQueryParameters) : string
Parameters
- $route : Route
- $remainingQueryParameters : array
-
reference to remaining query parameters
Return values
stringverifyRequiredParameters()
Check if controller+action combination matches
protected
verifyRequiredParameters(Route $route, array $parameters) : bool
Parameters
- $route : Route
- $parameters : array