Completed
Push — master ( 022281...f9cc19 )
by Elan
20s
created

Xhgui_Controller::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
use Slim\Slim;
4
5
abstract class Xhgui_Controller
6
{
7
    /**
8
     * @var array
9
     */
10
    protected $_templateVars = array();
11
12
    /**
13
     * @var string|null
14
     */
15
    protected $_template = null;
16
17
    /**
18
     * @var Slim
19
     */
20
    protected $app;
21
22
    public function __construct(Slim $app)
23
    {
24
        $this->app = $app;
25
    }
26
27
    public function set($vars)
28
    {
29
        $this->_templateVars = array_merge($this->_templateVars, $vars);
30
    }
31
32
    public function templateVars()
33
    {
34
        return $this->_templateVars;
35
    }
36
37
    public function render()
38
    {
39
        $this->app->render($this->_template, $this->_templateVars);
40
    }
41
42
}
43