class RegisterRoutersPass in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony-cmf/routing/DependencyInjection/Compiler/RegisterRoutersPass.php \Symfony\Cmf\Component\Routing\DependencyInjection\Compiler\RegisterRoutersPass
Compiler pass to register routers to the ChainRouter.
@author Wouter J <waldio.webdesign@gmail.com> @author Henrik Bjornskov <henrik@bjrnskov.dk> @author Magnus Nordlander <magnus@e-butik.se>
Hierarchy
- class \Symfony\Cmf\Component\Routing\DependencyInjection\Compiler\RegisterRoutersPass implements CompilerPassInterface
Expanded class hierarchy of RegisterRoutersPass
1 file declares its use of RegisterRoutersPass
- RegisterRoutersPassTest.php in vendor/
symfony-cmf/ routing/ Tests/ DependencyInjection/ Compiler/ RegisterRoutersPassTest.php
File
- vendor/
symfony-cmf/ routing/ DependencyInjection/ Compiler/ RegisterRoutersPass.php, line 25
Namespace
Symfony\Cmf\Component\Routing\DependencyInjection\CompilerView source
class RegisterRoutersPass implements CompilerPassInterface {
/**
* @var string
*/
protected $chainRouterService;
protected $routerTag;
public function __construct($chainRouterService = 'cmf_routing.router', $routerTag = 'router') {
$this->chainRouterService = $chainRouterService;
$this->routerTag = $routerTag;
}
public function process(ContainerBuilder $container) {
if (!$container
->hasDefinition($this->chainRouterService)) {
return;
}
$definition = $container
->getDefinition($this->chainRouterService);
foreach ($container
->findTaggedServiceIds($this->routerTag) as $id => $attributes) {
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
$definition
->addMethodCall('add', array(
new Reference($id),
$priority,
));
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RegisterRoutersPass:: |
protected | property | ||
RegisterRoutersPass:: |
protected | property | ||
RegisterRoutersPass:: |
public | function |
You can modify the container here before it is dumped to PHP code. Overrides CompilerPassInterface:: |
|
RegisterRoutersPass:: |
public | function |