Completed
Push — master ( fe1dad...5b05e2 )
by Eric
07:08
created

FormExtraExtension::javascript()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of the Ivory Form Extra package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\FormExtraBundle\Twig;
13
14
/**
15
 * Form Extra Twig extension.
16
 *
17
 * @author GeLo <[email protected]>
18
 */
19
class FormExtraExtension extends \Twig_Extension
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function getFunctions()
25
    {
26
        $options = array(
27
            'node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode',
28
            'is_safe'    => array('html'),
29
        );
30
31
        return array(
32
            new \Twig_SimpleFunction('form_javascript', null, $options),
33
            new \Twig_SimpleFunction('form_stylesheet', null, $options),
34
        );
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getName()
41
    {
42
        return 'ivory_form_extra';
43
    }
44
}
45