Passed
Push — master ( d9aedc...af986a )
by Jean-Christophe
07:55
created

CRUDFiles::getBaseTemplate()   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
dl 0
loc 2
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
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 7
	public function __construct() {
20 7
		$this->viewBase = "@framework/crud";
21 7
	}
22
23
	/**
24
	 * To override
25
	 * Returns the template for the index route (default : @framework/crud/index.html)
26
	 *
27
	 * @return string
28
	 */
29
	public function getViewIndex() {
30
		return $this->viewBase . "/index.html";
31
	}
32
33
	/**
34
	 * To override
35
	 * Returns the template for the edit and new instance routes (default : @framework/crud/form.html)
36
	 *
37
	 * @return string
38
	 */
39
	public function getViewForm() {
40
		return $this->viewBase . "/form.html";
41
	}
42
43
	/**
44
	 * To override
45
	 * Returns the template for the display route (default : @framework/crud/display.html)
46
	 *
47
	 * @return string
48
	 */
49
	public function getViewDisplay() {
50
		return $this->viewBase . "/display.html";
51
	}
52
53
	/**
54
	 * Returns the base template for all Crud actions if getBaseTemplate return a base template filename
55
	 *
56
	 * @return string
57
	 */
58
	public function getViewBaseTemplate() {
59
		return $this->viewBase . "/baseTemplate.html";
60
	}
61
62
	/**
63
	 * To override
64
	 * Returns the base template filename, default : null
65
	 */
66 7
	public function getBaseTemplate() {
67 7
		return;
68
	}
69
}
70
71