Skip to content

Commit 0358686

Browse files
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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

service_container/compiler_passes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ How to Work with Compiler Passes
22
================================
33

44
Compiler passes give you an opportunity to manipulate other
5-
:doc:`service definitions </service_container/definitions>` that have been
5+
:doc:`service definitions </dmanifestor/symfony-docs>` that have been
66
registered with the service container.
77

88
.. _kernel-as-compiler-pass:

0 commit comments

Comments
 (0)