PHP code example of adlogix / zf-symfony-container

1. Go to this page and download the library: Download adlogix/zf-symfony-container 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/ */

    

adlogix / zf-symfony-container example snippets



return [

    'zf_symfony_container' => [

        // directory where to look for the service container configurations (e.g. config/services.yaml)
        'config_dir' => 'config',

        // Caching options
        'cache' => [

            // directory where the cached container will be stored
            'dir' => 'data/ZfSymfonyContainer',

            // name of the file to generate the cached container class
            'filename' => 'zf_symfony_container_cache',

            // name of the class of the generated cached container
            'classname' => 'CachedContainer',

            // the namespace of the generated cached container
            'namespace' => 'Adlogix\ZfSymfonyContainer\DependencyInjection',

            // enable in dev mode
            'debug' => false
        ],


    ],
];



$service = $this->getServiceLocator()->get(\My\Public\Service::class);



$container = $this->getServiceLocator()->get('zf_symfony_container');


// global.php
return [
    'myconfig' => 'hello world' 
];


// global.php
return [
    'deep' => [
        'level' => [
            'config' => 'hello world'            
        ]    
    ]    
];