Skip to content

Instantly share code, notes, and snippets.

@kerasai
Created December 7, 2018 04:03
Show Gist options
  • Save kerasai/b9afa9842eeb2d635476400b500931f7 to your computer and use it in GitHub Desktop.
Save kerasai/b9afa9842eeb2d635476400b500931f7 to your computer and use it in GitHub Desktop.
Create a Symfony Container
<?php
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
// Build the container.
$container = new ContainerBuilder();
$loader = new YamlFileLoader($container, new FileLocator(__DIR__));
$loader->load('services.yml');
$container->compile();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment