<?php namespace Irstea\FileUploadBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader; use Symfony\Component\HttpKernel\DependencyInjection\Extension; class IrsteaFileUploadExtension 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('services.yml'); } /** * {@inheritdoc} */ public function prepend(ContainerBuilder $container) { $container->prependExtensionConfig( 'assetic', [ 'assets' => [ 'form_js' => [ 'inputs' => [ 'https://raw.githubusercontent.com/blueimp/jQuery-File-Upload/9.9.2/js/jquery.fileupload.js', '@IrsteaFileUploadBundle/Resources/js/widget/file_upload.js' ], ], ], ] ); $container->prependExtensionConfig( 'twig', [ 'form' => [ 'resources' => [ 'IrsteaFileUploadBundle:Form:file_upload.html.twig', ], ], ] ); } }