Completed
Push — development ( c8333e...45a59f )
by Alexander
05:26
created

Application::setRoute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Class with MVC implementation
4
 *
5
 * @file      Application.php
6
 *
7
 * PHP version 5.4+
8
 *
9
 * @author    Alexander Yancharuk <alex at itvault dot info>
10
 * @copyright © 2012-2015 Alexander Yancharuk <alex at itvault at info>
11
 * @date      Птн Июн 08 18:10:37 2012
12
 * @license   The BSD 3-Clause License
13
 *            <https://tldrlegal.com/license/bsd-3-clause-license-(revised)>
14
 */
15
16
namespace Veles\Application;
17
18
use Veles\Auth\UsrAuth;
19
use Veles\View\View;
20
21
/**
22
 * Class Application
23
 * @author  Alexander Yancharuk <alex at itvault dot info>
24
 */
25
class Application
26
{
27
	use RouteTrait;
28
29
	/**
30
	 * Application start
31
	 */
32 1
	public function run()
33
	{
34 1
		UsrAuth::instance();
35
36 1
		$controller  = $this->getRoute()->getController();
37 1
		$action_name = $this->getRoute()->getActionName();
38 1
		$template    = $this->getRoute()->getTemplate();
39
40 1
		View::setAdapter($this->getRoute()->getAdapter());
41 1
		View::set($controller->$action_name());
42
43 1
		View::show($template);
44 1
	}
45
}
46