class RegisterRouteEnhancersPass in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony-cmf/routing/DependencyInjection/Compiler/RegisterRouteEnhancersPass.php \Symfony\Cmf\Component\Routing\DependencyInjection\Compiler\RegisterRouteEnhancersPass
This compiler pass adds additional route enhancers to the dynamic router.
@author Daniel Leech <dan.t.leech@gmail.com> @author Nathaniel Catchpole (catch)
Hierarchy
- class \Symfony\Cmf\Component\Routing\DependencyInjection\Compiler\RegisterRouteEnhancersPass implements CompilerPassInterface
Expanded class hierarchy of RegisterRouteEnhancersPass
1 file declares its use of RegisterRouteEnhancersPass
- RegisterRouteEnhancersPassTest.php in vendor/
symfony-cmf/ routing/ Tests/ DependencyInjection/ Compiler/ RegisterRouteEnhancersPassTest.php
File
- vendor/
symfony-cmf/ routing/ DependencyInjection/ Compiler/ RegisterRouteEnhancersPass.php, line 25
Namespace
Symfony\Cmf\Component\Routing\DependencyInjection\CompilerView source
class RegisterRouteEnhancersPass implements CompilerPassInterface {
/**
* @var string
*/
protected $dynamicRouterService;
protected $enhancerTag;
public function __construct($dynamicRouterService = 'cmf_routing.dynamic_router', $enhancerTag = 'dynamic_router_route_enhancer') {
$this->dynamicRouterService = $dynamicRouterService;
$this->enhancerTag = $enhancerTag;
}
public function process(ContainerBuilder $container) {
if (!$container
->hasDefinition($this->dynamicRouterService)) {
return;
}
$router = $container
->getDefinition($this->dynamicRouterService);
foreach ($container
->findTaggedServiceIds($this->enhancerTag) as $id => $attributes) {
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
$router
->addMethodCall('addRouteEnhancer', array(
new Reference($id),
$priority,
));
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RegisterRouteEnhancersPass:: |
protected | property | ||
RegisterRouteEnhancersPass:: |
protected | property | ||
RegisterRouteEnhancersPass:: |
public | function |
You can modify the container here before it is dumped to PHP code. Overrides CompilerPassInterface:: |
|
RegisterRouteEnhancersPass:: |
public | function |