Skip to content

Instantly share code, notes, and snippets.

@coreymcmahon
Created June 14, 2012 12:22
Show Gist options
  • Save coreymcmahon/2929969 to your computer and use it in GitHub Desktop.
Save coreymcmahon/2929969 to your computer and use it in GitHub Desktop.
Introducing dependency injection into Simplex - http://www.symfonycentral.com
<?php
// example.com/src/container.php
use Symfony\Component\DependencyInjection;
use Symfony\Component\DependencyInjection\Reference;
$sc = new DependencyInjection\ContainerBuilder();
$sc->register('context', 'Symfony\Component\Routing\RequestContext');
$sc->register('matcher', 'Symfony\Component\Routing\Matcher\UrlMatcher')
->setArguments(array($routes, new Reference('context')))
;
// ... etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment