Test Setup Failed
Push — master ( 3028d7...678984 )
by Markus
03:32
created

HomeController::indexAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 14
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Anax\Home;
4
5
use Anax\Commons\ContainerInjectableInterface;
6
use Anax\Commons\ContainerInjectableTrait;
7
use Anax\Forum\Forum;
8
9
class HomeController implements ContainerInjectableInterface
10
{
11
    use ContainerInjectableTrait;
12
13
    public function indexAction()
14
    {
15
        $title = "Home page";
16
        $forum = new Forum();
17
        $forum->setDb($this->di->get("dbqb"));
18
19
        $page = $this->di->get("page");
20
21
        $page->add("home/index", [
22
            "items" => $forum->findAll(),
23
        ]);
24
25
        return $page->render([
26
            "title" => $title,
27
        ]);
28
    }
29
}
30