Passed
Push — master ( f7ade8...7e9287 )
by Jean-Christophe
11:26
created

CRUDFiles::getViewNav()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 2
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Ubiquity\controllers\crud;
4
5
use Ubiquity\controllers\crud\traits\UrlsTrait;
6
7
/**
8
 *
9
 * @author jc
10
 *
11
 */
12
class CRUDFiles {
13
	use UrlsTrait;
14
	protected $viewBase;
15
16
	/**
17
	 * To override for defining viewBase (default : @framework/crud)
18
	 */
19 6
	public function __construct(string $viewBase='@framework/crud') {
20 6
		$this->viewBase = $viewBase;
21 6
	}
22
23
	/**
24
	 * To override
25
	 * Returns the template for the index route (default : @framework/crud/index.html)
26
	 *
27
	 * @return string
28
	 */
29 1
	public function getViewIndex() {
30 1
		return $this->viewBase . '/index.html';
31
	}
32
	
33
	/**
34
	 * To override with MultiResourceCRUDController only
35
	 * Returns the template for the home route (default : @framework/crud/home.html)
36
	 *
37
	 * @return string
38
	 */
39 1
	public function getViewHome(){
40 1
		return $this->viewBase . '/home.html';
41
	}
42
43
	/**
44
	 * To override with MultiResourceCRUDController only
45
	 * Returns the template for an item in home route (default : @framework/crud/itemHome.html)
46
	 *
47
	 * @return string
48
	 */
49 1
	public function getViewItemHome(){
50 1
		return $this->viewBase . '/itemHome.html';
51
	}
52
53
	/**
54
	 * To override with MultiResourceCRUDController only
55
	 * Returns the template for displaying models in a dropdown (default : @framework/crud/itemHome.html)
56
	 *
57
	 * @return string
58
	 */
59 1
	public function getViewNav(){
60 1
		return $this->viewBase . '/nav.html';
61
	}
62
63
	/**
64
	 * To override
65
	 * Returns the template for the edit and new instance routes (default : @framework/crud/form.html)
66
	 *
67
	 * @return string
68
	 */
69
	public function getViewForm() {
70
		return $this->viewBase . '/form.html';
71
	}
72
73
	/**
74
	 * To override
75
	 * Returns the template for the display route (default : @framework/crud/display.html)
76
	 *
77
	 * @return string
78
	 */
79
	public function getViewDisplay() {
80
		return $this->viewBase . '/display.html';
81
	}
82
83
	/**
84
	 * Returns the base template for all Crud actions if getBaseTemplate return a base template filename
85
	 *
86
	 * @return string
87
	 */
88
	public function getViewBaseTemplate() {
89
		return $this->viewBase . '/baseTemplate.html';
90
	}
91
92
	/**
93
	 * To override
94
	 * Returns the base template filename, default : null
95
	 */
96 6
	public function getBaseTemplate() {
97 6
		return;
98
	}
99
}
100
101