Div::render()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 11
ccs 7
cts 7
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: filipesilva
5
 * Date: 10/02/16
6
 * Time: 01:16
7
 */
8
9
namespace Slick\Form\Renderer;
10
11
12
class Div extends AbstractRenderer implements RendererInterface
13
{
14
15
    /**
16
     * @var string The template file to use in the rendering
17
     */
18
    public $template = 'form-elements/default.twig';
19
20
    /**
21
     * Render the HTML element in the provided context
22
     *
23
     * @param array $context
24
     *
25
     * @return string The HTML string output
26
     */
27 20
    public function render($context = [])
28
    {
29 20
        parent::render($context);
30 20
        $this->getEngine()->parse($this->template);
31
        $data = [
32 20
            'element' => $this->getElement(),
33 20
            'context' => $context,
34
            'renderer' => $this
35 20
        ];
36 20
        return $this->getEngine()->process($data);
37
    }
38
}