PHP code example of alexpts / symfony-di-loader

1. Go to this page and download the library: Download alexpts/symfony-di-loader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alexpts / symfony-di-loader example snippets



use PTS\SymfonyDiLoader\LoaderContainer;

$configs = [
    __DIR__ . './container.yml',
    __DIR__ . './container.xml',
    __DIR__ . './container.php'
];
$fileCache = __DIR__ . '/var/di.php';
$isDebug = true;

$loader = new LoaderContainer;
$container = $loader->getContainer($configs, $fileCache, $isDebug);

use PTS\SymfonyDiLoader\LoaderContainer;

$loader = new LoaderContainer;
$builder = $loader->getBuilder();
$builder->addExtension($someContainerExtension);
$container = $loader->getContainer($configs, $fileCache);