Conditions | 3 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 5 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
21 | public function register(Application $app) |
||
22 | { |
||
23 | |||
24 | if ($app->offsetExists('form.factory')) { |
||
25 | $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) { |
||
26 | $types[] = new Form\Type\MediaType($app); |
||
27 | return $types; |
||
28 | })); |
||
29 | } |
||
30 | |||
31 | if ($app->offsetExists('twig')) { |
||
32 | $app['twig'] = $app->share($app->extend('twig', function(\Twig_Environment $twig) use ($app) { |
||
33 | $twig->addExtension(new Twig\MediaExtension($app)); |
||
34 | return $twig; |
||
35 | })); |
||
36 | |||
37 | $app['twig.path'] = array_merge($app['twig.path'], array( |
||
38 | __DIR__ . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'views' |
||
39 | )); |
||
40 | |||
41 | $app['twig.form.templates'] = array_merge($app['twig.form.templates'], array("media.type.html.twig")); |
||
42 | } |
||
43 | } |
||
44 | |||
46 |