Passed
Push — master ( e0d6a2...2ec881 )
by Anton
05:25 queued 02:20
created

Form   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 38
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLayout() 0 20 1
A display() 0 4 1
1
<?php
2
3
/**
4
 * @package Cadmium\System\Frames\Admin
5
 * @author Anton Romanov
6
 * @copyright Copyright (c) 2015-2017, Anton Romanov
7
 * @link http://cadmium-cms.com
8
 */
9
10
namespace Frames\Admin\View {
11
12
	use Frames, Utils\Messages, Language, Template;
13
14
	class Form extends Frames\Admin\View {
15
16
		protected $view = 'Form', $status = STATUS_CODE_401;
17
18
		/**
19
		 * Get a layout block
20
		 */
21
22
		private function getLayout(Template\Block $contents) : Template\Block {
23
24
			$layout = self::get('Layouts/Form');
25
26
			# Set title
27
28
			$layout->title = Language::get($this->title);
29
30
			# Set messages
31
32
			$layout->messages = Messages::block();
33
34
			# Set contents
35
36
			$layout->contents = $contents;
37
38
			# ------------------------
39
40
			return $layout;
41
		}
42
43
		/**
44
		 * Output the page contents
45
		 */
46
47
		public function display(Template\Block $contents) {
48
49
			return $this->_display($this->getLayout($contents));
50
		}
51
	}
52
}
53