-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathController.php
More file actions
43 lines (35 loc) · 846 Bytes
/
Controller.php
File metadata and controls
43 lines (35 loc) · 846 Bytes
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
<?php
/**
* @author Ryan Edge <ryan@blueacorn.com>
* @description MVC Base Controller
*
* @link https://bitbucket.org/baryan
*
*/
//namespace baryan\MyMVC
class Controller
{
/** @var object $view Set from the bootstrap */
public $view;
/** @var object $model Set from the bootstrap */
public $model;
// ------------------------------------------------------------------------
/**
* __construct - Required
*/
public function __construct()
{
echo "Base Controller Loaded...";
}
// ------------------------------------------------------------------------
/**
*
*
*/
public function loadModel($name, $path='models/M_')
{
require_once($path . ucfirst($name) . '.php');
return new $this->model;
}
}
/** eof */