Completed
Pull Request — master (#21)
by Michal
02:30
created

BreadcrumbControl::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
crap 2
1
<?php
2
3
namespace UniMan\Components\Breadcrumb;
4
5
use Nette\Application\UI\Control;
6
7
class BreadcrumbControl extends Control
8
{
9
    private $driver;
10
11
    private $database;
12
13
    private $type;
14
15
    private $table;
16
17
    private $item;
18
19
    public function __construct($driver, $database, $type, $table, $item)
20
    {
21
        parent::__construct();
22
        $this->driver = $driver;
23
        $this->database = $database;
24
        $this->type = $type;
25
        $this->table = $table;
26
        $this->item = $item;
27
    }
28
29
    public function render()
30
    {
31
        $this->template->driver = $this->driver;
32
        $this->template->database = $this->database;
33
        $this->template->type = $this->type;
34
        $this->template->table = $this->table;
35
        $this->template->item = $this->item;
36
        $this->template->setFile(__DIR__ . '/default.latte');
37
        $this->template->render();
38
    }
39
}
40