-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHome.php
58 lines (49 loc) · 1.6 KB
/
Home.php
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
<?php
/**
* This file is part of the Sunhill Framework package.
*
* (c) Mehmet Selcuk Batal, Sunhill Technology <batalms@gmail.com>
*
* Licensed under The GNU Lesser General Public License, version 3.0
* Redistributions of files must retain the above copyright notice.
*/
/**
* Namespace for controller
* Use App/Controllers directory
*/
namespace App\Controllers;
/**
* Inherit from the main controller
* Don't change parent controller path and name
*/
class Home extends \Core\Controller
{
/**
* Construct method of the inherited controller
* Don't change the parameters if not needed
*
* @param string $view
* @param object $model
* @param array $params
*/
public function __construct($view = null, $model = null, $params = null) {
$this->view = $view; // view file's address (in views directory)
$this->model = $model; // model object (created by parent class)
$this->params = $params; // parameters (if needed for model)
}
/**
* Main method of the controller
* Don't change the method's name
* If this page is called by a browser without method parameter, this will work first
*/
public function show() {
// if this page needs database, call model class' show method here
// for details, see the description and/or example files (test directory)
require_once ($this->view); // include view file (with $result content)
}
/**
* Other optional methods used in URL's custom [Method Name] part
* Structure: .....[URL]...../[Class Name]/[Method Name]/[Parameters]
*/
}
?>