Passed
Push — master ( 617c92...5e6e10 )
by Jean-Christophe
05:35
created

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