Commit 0358686
authored
Fix link to service definitions in documentation
use Symfony\Component\DependencyInjection\Definition;
// finds out if there is an "app.mailer" definition
$container->hasDefinition('app.mailer');
// finds out if there is an "app.mailer" definition or alias
$container->has('app.mailer');
// gets the "app.user_config_manager" definition
$definition = $container->getDefinition('app.user_config_manager');
// gets the definition with the "app.user_config_manager" ID or alias
$definition = $container->findDefinition('app.user_config_manager');
// adds a new "app.number_generator" definition
$definition = new Definition(\App\NumberGenerator::class);
$container->setDefinition('app.number_generator', $definition);
// shortcut for the previous method
$container->register('app.number_generator', \App\NumberGenerator::class);1 parent c9cb42a commit 0358686
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments