Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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',
],
],
]
);
}
}