src/DependencyInjection/LAGAdminExtension.php
public function load(array $configs, ContainerBuilder $builder)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($builder, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yaml');
        $loader->load('services/factories.yaml');
        $loader->load('services/fields.yaml');
        $loader->load('services/resources.yaml');
        $loader->load('services/subscribers.yaml');
        $loader->load('services/twig.yaml');

        if ('dev' === $builder->getParameter('kernel.environment')) {
            $loader->load('services_dev.yaml');
        }
        $applicationConfig = [];
        $adminsConfig = [];
        $menusConfig = [];
        $enableExtraConfig = true;

        if (key_exists('application', $config)) {
            if (key_exists('enable_extra_configuration', $config['application'])) {
                $enableExtraConfig = $config['application']['enable_extra_configuration'];
            }
            $applicationConfig = $config['application'];
        }

        if (key_exists('admins', $config)) {
            $adminsConfig = $config['admins'];
        }

        if (key_exists('menus', $config)) {
            $menusConfig = $config['menus'];

            foreach ($menusConfig as $name => $menu) {
                if (null === $menu) {
                    $menusConfig[$name] = [];
                }
            }
        }
        $builder->setParameter('lag.admin.enable_extra_configuration', $enableExtraConfig);
        $builder->setParameter('lag.admin.application_configuration', $applicationConfig);
        $builder->setParameter('lag.admins', $adminsConfig);
        $builder->setParameter('lag.menus', $menusConfig);
    }
public function load(array $configs, ContainerBuilder $builder)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($builder, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yaml');
        $loader->load('services/factories.yaml');
        $loader->load('services/fields.yaml');
        $loader->load('services/resources.yaml');
        $loader->load('services/subscribers.yaml');
        $loader->load('services/twig.yaml');

        if ('dev' === $builder->getParameter('kernel.environment')) {
            $loader->load('services_dev.yaml');
        }
        $applicationConfig = [];
        $adminsConfig = [];
        $menusConfig = [];
        $enableExtraConfig = true;

        if (key_exists('application', $config)) {
            if (key_exists('enable_extra_configuration', $config['application'])) {
                $enableExtraConfig = $config['application']['enable_extra_configuration'];
            }
            $applicationConfig = $config['application'];
        }

        if (key_exists('admins', $config)) {
            $adminsConfig = $config['admins'];
        }

        if (key_exists('menus', $config)) {
            $menusConfig = $config['menus'];

            foreach ($menusConfig as $name => $menu) {
                if (null === $menu) {
                    $menusConfig[$name] = [];
                }
            }
        }
        $builder->setParameter('lag.admin.enable_extra_configuration', $enableExtraConfig);
        $builder->setParameter('lag.admin.application_configuration', $applicationConfig);
        $builder->setParameter('lag.admins', $adminsConfig);
        $builder->setParameter('lag.menus', $menusConfig);
    }
public function load ( array $ configs , ContainerBuilder $ builder ) { $ configuration = new Configuration ( ) ; $ config = $ this -> processConfiguration ( $ configuration , $ configs ) ; $ loader = new Loader \ YamlFileLoader ( $ builder , new FileLocator ( __DIR__ . '/../Resources/config' ) ) ; $ loader -> load ( 'services.yaml' ) ; $ loader -> load ( 'services/factories.yaml' ) ; $ loader -> load ( 'services/fields.yaml' ) ; $ loader -> load ( 'services/resources.yaml' ) ; $ loader -> load ( 'services/subscribers.yaml' ) ; $ loader -> load ( 'services/twig.yaml' ) ; if ( 'dev' === $ builder -> getParameter ( 'kernel.environment' ) ) { $ loader -> load ( 'services_dev.yaml' ) ; } $ applicationConfig = [ ] ; $ adminsConfig = [ ] ; $ menusConfig = [ ] ; $ enableExtraConfig = true ; if ( key_exists ( 'application' , $ config ) ) { if ( key_exists ( 'enable_extra_configuration' , $ config [ 'application' ] ) ) { $ enableExtraConfig = $ config [ 'application' ] [ 'enable_extra_configuration' ] ; } $ applicationConfig = $ config [ 'application' ] ; } if ( key_exists ( 'admins' , $ config ) ) { $ adminsConfig = $ config [ 'admins' ] ; } if ( key_exists ( 'menus' , $ config ) ) { $ menusConfig = $ config [ 'menus' ] ; foreach ( $ menusConfig as $ name => $ menu ) { if ( null === $ menu ) { $ menusConfig [ $ name ] = [ ] ; } } } $ builder -> setParameter ( 'lag.admin.enable_extra_configuration' , $ enableExtraConfig ) ; $ builder -> setParameter ( 'lag.admin.application_configuration' , $ applicationConfig ) ; $ builder -> setParameter ( 'lag.admins' , $ adminsConfig ) ; $ builder -> setParameter ( 'lag.menus' , $ menusConfig ) ; }
Load the configuration into the container.

@param array $configs
@param ContainerBuilder $builder
Load the configuration into the container .