-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBase.php
More file actions
84 lines (75 loc) · 1.57 KB
/
Base.php
File metadata and controls
84 lines (75 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
namespace Colibri\Controller;
use Colibri\Base\PropertyAccess;
/**
* Base controller class.
*
* @property string $response
* @property string $division site division
* @property string $module
* @property string $method
*/
abstract class Base extends PropertyAccess
{
/**
* @var string
*/
protected $_response = null;
/**
* @var string
*/
protected $_division = null;
/**
* @var string
*/
protected $_module = null;
/**
* @var string
*/
protected $_method = null;
/**
* Base constructor.
*
* @param string $division
* @param string $module
* @param string $method
*/
final public function __construct($division, $module, $method)
{
$this->_division = $division;
$this->_module = $module;
$this->_method = $method;
$this->init();
}
/**
* Custom initialize for controller (calls after ::__construct()).
*/
protected function init()
{
}
/**
* Custom setups before controller-method called (calls each time before any ::$method() called).
*/
public function setUp()
{
}
/**
* Custom cleanups after controller-method called (calls each time after any ::$method() called).
*/
public function tearDown()
{
}
/**
* Custom utilize/cleanups for whole controller (calls in ::__destruct()).
*/
protected function done()
{
}
/**
* Base destructor.
*/
final public function __destruct()
{
$this->done();
}
}