To see the complete documentation, check out DependencyInjection
composer require sergiors/dependency-injection-service-provider "dev-master"
use Silex\Application;
use Sergiors\Silex\Provider\DependencyInjectionServiceProvider;
$app = new Application();
$app->register(new DependencyInjectionServiceProvider());
$app['di.loader']->load('{your config file/dir}');
$app->get('/', function () use ($app) {
return $app['di.container']->get('{your var}');
});
$app->run();
MIT