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

        $container->setParameter('sulu_form.mail.from', $config['mail']['from']);
        $container->setParameter('sulu_form.mail.to', $config['mail']['to']);
        $container->setParameter('sulu_form.mail.template.notify', $config['mail']['templates']['notify']);
        $container->setParameter('sulu_form.mail.template.customer', $config['mail']['templates']['customer']);
        $container->setParameter('sulu_form.ajax_templates', $config['ajax_templates']);
        $container->setParameter('sulu_form.dynamic_widths', $config['dynamic_widths']);
        $container->setParameter('sulu_form.dynamic_auto_title', $config['dynamic_auto_title']);
        $container->setParameter('sulu_form.mailchimp_api_key', $config['mailchimp_api_key']);
        $container->setParameter('sulu_form.mailchimp_subscribe_status', $config['mailchimp_subscribe_status']);
        $container->setParameter('sulu_form.dynamic_lists.config', $config['dynamic_lists']);
        $container->setParameter('sulu_form.media_collection_strategy', $config['media_collection_strategy']);
        $container->setParameter('sulu_form.static_forms', $config['static_forms']);
        $container->setParameter('sulu_form.dynamic_disabled_types', $config['dynamic_disabled_types']);

        // Default Media Collection Strategy
        $container->setAlias(
            'sulu_form.media_collection_strategy.default',
            'sulu_form.media_collection_strategy.' . $config['media_collection_strategy']
        );

        // add dynamic lists
        $dynamicLists = $config['dynamic_lists'];
        if (!isset($dynamicLists['sulu_form_form'])) {
            $dynamicLists['sulu_form_form'] = [
                'form' => [
                    'property' => 'id',
                    'position' => 40,
                    'name' => 'sulu_form.navigation.data',
                    'width' => 'max',
                ],
            ];
        }

        foreach ($dynamicLists as $key => $value) {
            $parameter = 'sulu_form.dynamic_lists.' . $key . '.config';
            $container->setParameter($parameter, $value ?: []);

            $definition = new Definition(DynamicListNavigationProvider::class);
            $definition->addArgument('%' . $parameter . '%');
            $definition->setClass(DynamicListNavigationProvider::class);
            $definition->addTag('sulu_admin.content_navigation', ['alias' => $key]);
            $definition->addTag('sulu.context', ['context' => 'admin']);
            $container->setDefinition('sulu_form.navigation_provider.' . $key . '.dynamic_list', $definition);
        }

        // Dynamic List Builder
        $container->setParameter(
            'sulu_form.dynamic_list_builder.default',
            $config['dynamic_list_builder']['default']
        );

        $container->setParameter(
            'sulu_form.dynamic_list_builder.delimiter',
            $config['dynamic_list_builder']['delimiter']
        );

        // Load services
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.xml');
        $loader->load('types.xml');
        $loader->load('title-providers.xml');

        if ($config['mailchimp_api_key']) {
            $loader->load('type_mailchimp.xml');
        }

        $bundles = $container->getParameter('kernel.bundles');

        if (array_key_exists('SuluArticleBundle', $bundles)) {
            $loader->load('article.xml');
        }

        if (class_exists(\EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType::class)) {
            $loader->load('type_recaptcha.xml');
        }
    }
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $container->setParameter('sulu_form.mail.from', $config['mail']['from']);
        $container->setParameter('sulu_form.mail.to', $config['mail']['to']);
        $container->setParameter('sulu_form.mail.template.notify', $config['mail']['templates']['notify']);
        $container->setParameter('sulu_form.mail.template.customer', $config['mail']['templates']['customer']);
        $container->setParameter('sulu_form.ajax_templates', $config['ajax_templates']);
        $container->setParameter('sulu_form.dynamic_widths', $config['dynamic_widths']);
        $container->setParameter('sulu_form.dynamic_auto_title', $config['dynamic_auto_title']);
        $container->setParameter('sulu_form.mailchimp_api_key', $config['mailchimp_api_key']);
        $container->setParameter('sulu_form.mailchimp_subscribe_status', $config['mailchimp_subscribe_status']);
        $container->setParameter('sulu_form.dynamic_lists.config', $config['dynamic_lists']);
        $container->setParameter('sulu_form.media_collection_strategy', $config['media_collection_strategy']);
        $container->setParameter('sulu_form.static_forms', $config['static_forms']);
        $container->setParameter('sulu_form.dynamic_disabled_types', $config['dynamic_disabled_types']);

        // Default Media Collection Strategy
        $container->setAlias(
            'sulu_form.media_collection_strategy.default',
            'sulu_form.media_collection_strategy.' . $config['media_collection_strategy']
        );

        // add dynamic lists
        $dynamicLists = $config['dynamic_lists'];
        if (!isset($dynamicLists['sulu_form_form'])) {
            $dynamicLists['sulu_form_form'] = [
                'form' => [
                    'property' => 'id',
                    'position' => 40,
                    'name' => 'sulu_form.navigation.data',
                    'width' => 'max',
                ],
            ];
        }

        foreach ($dynamicLists as $key => $value) {
            $parameter = 'sulu_form.dynamic_lists.' . $key . '.config';
            $container->setParameter($parameter, $value ?: []);

            $definition = new Definition(DynamicListNavigationProvider::class);
            $definition->addArgument('%' . $parameter . '%');
            $definition->setClass(DynamicListNavigationProvider::class);
            $definition->addTag('sulu_admin.content_navigation', ['alias' => $key]);
            $definition->addTag('sulu.context', ['context' => 'admin']);
            $container->setDefinition('sulu_form.navigation_provider.' . $key . '.dynamic_list', $definition);
        }

        // Dynamic List Builder
        $container->setParameter(
            'sulu_form.dynamic_list_builder.default',
            $config['dynamic_list_builder']['default']
        );

        $container->setParameter(
            'sulu_form.dynamic_list_builder.delimiter',
            $config['dynamic_list_builder']['delimiter']
        );

        // Load services
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.xml');
        $loader->load('types.xml');
        $loader->load('title-providers.xml');

        if ($config['mailchimp_api_key']) {
            $loader->load('type_mailchimp.xml');
        }

        $bundles = $container->getParameter('kernel.bundles');

        if (array_key_exists('SuluArticleBundle', $bundles)) {
            $loader->load('article.xml');
        }

        if (class_exists(\EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType::class)) {
            $loader->load('type_recaptcha.xml');
        }
    }
{@inheritdoc}