View class, refactoring

This commit is contained in:
xinatorus
2020-05-04 21:19:14 +02:00
parent 8d2af9181a
commit 63e7c95415
8 changed files with 104 additions and 40 deletions

View File

@@ -3,12 +3,8 @@
class ExampleController extends Controller{
public function index(){
echo 'example';
// TODO:
// - set view
// - process POST variables
// ...
$this->view->title = 'Example title';
$this->view->render('example.phtml');
}
public function subpage(){

View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $this->title ?></title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<header>
{HEADER}
</header>
<?php echo $this->content(); ?>
<footer>
{FOOTER}
</footer>
</body>
</html>

View File

@@ -0,0 +1 @@
Example template

View File

@@ -1,20 +0,0 @@
.loader {
border: 16px solid #f3f3f3;
border-radius: 50%;
border-top: 16px solid #3498db;
width: 120px;
height: 120px;
-webkit-animation: spin 2s linear infinite; /* Safari */
animation: spin 2s linear infinite;
}
/* Safari */
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}