symfony Service Container Retrieve a service from the container


Example

$logger = $container->get('logger');

This will fetch the service with the service ID "logger" from the container, an object that implements Psr\Log\LoggerInterface.