TagExtension::getFunctions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 1
Metric Value
c 4
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Rafidion Michael
5
 * Date: 10/12/2014
6
 * Time: 22:12
7
 */
8
9
namespace Mykees\TagBundle\Twig\Extension;
10
11
class TagExtension extends \Twig_Extension {
12
13
14
    public function getFunctions()
15
    {
16
        return array(
17
            new \Twig_SimpleFunction('mk_tag_javascript', [$this, 'init'], [
18
                'is_safe'=>array('html'),
19
                'needs_environment'=>true
20
            ])
21
        );
22
    }
23
24
    public function init(\Twig_Environment $env){
25
        return  $env->render('MykeesTagBundle:Tpl:javascript.html.twig');
26
    }
27
28
    public function getName()
29
    {
30
        return "mykees_tag_extension";
31
    }
32
}
33