0
votes

I just created a symfony DI extension , where I'm trying to append some form theme configuration to my app/config.yml.

1) My Extension class:

class ELFinderFieldTypeExtension extends Extension implements PrependExtensionInterface
{
    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

        $loader->load('form_themes.yml');
    }
...

2) My form_themes.yml

twig:
    form_themes:
        - 'ELFinderFieldTypeBundle:elfinder:elfinder_widget.html.twig'

Unfortunately, It's not the right way to load a twig config, that's way I'm getting kind of:

There is no extension able to load the configuration for "twig" (in /var/www/html/..../DependencyInjection/../Resources/config/form_themes.yml). Looked for namespace "twig", found none

Anyone have any idea would be voted and appreciated.

1

1 Answers

0
votes

I found an easy solution, ally I need is to append my config after implementing PrependExtensionInterface Interface:

public function prepend(ContainerBuilder $container)
{
    $configFile = \sprintf('%s%s', __DIR__, '/../Resources/config/form_themes.yml');
    $this->prependYamlConfigFile($container, 'twig', $configFile);
}