Newer
Older
<?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)
{
Guillaume Perréal
committed
$version = '9.9.2';
$container->prependExtensionConfig(
'assetic',
[
'assets' => [
'form_js' => [
'inputs' => [
Guillaume Perréal
committed
"https://raw.githubusercontent.com/blueimp/jQuery-File-Upload/$version/js/jquery.fileupload.js",
"https://raw.githubusercontent.com/blueimp/jQuery-File-Upload/$version/js/jquery.fileupload-process.js",
"https://raw.githubusercontent.com/blueimp/jQuery-File-Upload/$version/js/jquery.fileupload-validate.js",
"https://raw.githubusercontent.com/blueimp/jQuery-File-Upload/$version/js/jquery.fileupload-ui.js",
'@IrsteaFileUploadBundle/Resources/js/widget/file_upload.js'
],
],
Guillaume Perréal
committed
'form_css' => [
'inputs' => [
"https://raw.githubusercontent.com/blueimp/jQuery-File-Upload/$version/css/jquery.fileupload.css",
],
],