Commit 445bd951 authored by Lukáš Bachleda's avatar Lukáš Bachleda

Views

parent 188ab0e8
Pipeline #21906 failed with stages
......@@ -7,7 +7,21 @@ class RouterController extends Controller
public function process($params) {
$parsedUrl = $this->parseUrl($params[0]);
$classController = $this->toCamelCase(array_shift($parsedUrl)) . 'Controller';
if (empty($naparsovanaURL[0]))
$this->presmeruj('article/uvod');
$classController = $this->toCamelCase($parsedUrl[1]) . 'Controller';
if (file_exists('controllers/' . $classController . '.php'))
$this->controller = new $classController;
else
$this->redirect('error');
$this->controller->process($parsedUrl);
$this->data['title'] = $this->controller->header['title'];
$this->data['keywords'] = $this->controller->header['keywords'];
$this->view = 'layout';
}
private function parseUrl($url) {
......
......@@ -13,4 +13,6 @@ function autoLoaderEngine($class)
spl_autoload_register("autoLoaderEngine");
$router = new RouterKontroler();
$router->process(array($_SERVER['REQUEST_URI']));
\ No newline at end of file
$router->process(array($_SERVER['REQUEST_URI']));
$router->renderView();
\ No newline at end of file
body {
font-family: verdana;
font-size: 14px;
width: 900px;
margin: 0 auto;
}
h1 {
text-align: center;
color: #444444;
text-shadow: 3px 3px 3px #aaaaaa;
}
footer {
font-size: 11px;
text-align: center;
padding-top: 20px;
}
article {
text-shadow: 3px 3px 3px #aaaaaa;
}
nav ul {
list-style-type: none;
}
nav li {
float: left;
margin-right: 15px;
}
nav a {
background: #6FA4F8;
color: white;
padding: 5px 10px;
border-radius: 10px;
text-decoration: none;
border: none;
cursor: pointer;
}
nav a:hover {
background: #2976f8;
color: #EEEEEE;
text-decoration: none;
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="cs-cz">
<html lang="sk-SK">
<head>
<base href="/localhost" />
<meta charset="UTF-8" />
......@@ -23,7 +23,7 @@
<br clear="both" />
<article>
<?php $this->controller->renderView(); ?>
</article>
<footer>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment