Completed
Push — master ( 233724...bf3697 )
by Park Jong-Hun
07:55
created

Welcome::viewRoutePaths()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
namespace App\Controller\Admin;
4
5
use Core\Application;
6
use Core\ViewModel;
7
8
class Welcome {
9
    public function __construct(ViewModel $view, $urlPattern)
10
    {
11
        $view->set('nav', $urlPattern);
12
    }
13
14
    public function index(ViewModel $view) {
15
        $view->set('siteUrl', Application::getUrl());
16
        $view->set('sitePublicUrl', Application::getPublicUrl());
17
18
        $view->set('absolutePath', realpath(__DIR__ . '/../../'));
19
        $view->set('phpVersion', PHP_VERSION);
20
        $view->set('os', PHP_OS);
21
        $view->set('sapi', PHP_SAPI);
22
23
        return 'server';
24
    }
25
26
    public function viewRoutePaths(ViewModel $view) {
27
        $routePaths = AdminService::getRoutePaths();
28
        unset($routePaths['namespace']);
29
30
        $view->set('namespace', AdminService::getRoutePaths()['namespace']);
31
        $view->set('routePaths', $routePaths);
32
33
        return 'route';
34
    }
35
}