Added: MVC structure, Router, Views and Controllers for home page and login/signup
This commit is contained in:
22
app/controllers/HomeController.php
Normal file
22
app/controllers/HomeController.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
class HomeController {
|
||||
//private function render($view) {
|
||||
// ob_start();
|
||||
// require_once views . $view;
|
||||
// $content = ob_get_clean();
|
||||
// require_once views . 'layouts/base.php';
|
||||
//}
|
||||
public function index() {
|
||||
$view = new View();
|
||||
$data = [
|
||||
'title' => 'Home'
|
||||
];
|
||||
$view->render('home/index', $data);
|
||||
//require_once views . 'home/index.php';
|
||||
}
|
||||
|
||||
public function home() {
|
||||
$this->index();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user