Skip to content
Snippets Groups Projects
Commit b08fd9f3 authored by Matthieu Guffroy's avatar Matthieu Guffroy
Browse files

Implement mainController

parent ce25c128
No related branches found
No related tags found
No related merge requests found
......@@ -2,14 +2,25 @@
// This file is the main controller
include 'template/header.php';
// TODO: Handle url to detect wich controller to call
// Handle url
$url = explode("/", $_SERVER['PHP_SELF']);
if(isset($url[3])) {
$page = $url[3];
} else {
$page = "index";
}
if(isset($url[4])) {
$action = $url[4];
} else {
$action = "";
}
if(!file_exists('controller/'.$page.'.php')) { $page = "404"; }
// Show the menu, the previous part have set wich page we are on to set the "active" class in menu
include 'template/menu.php';
// TODO: Call the correct controller
include 'controller/index.php';
// Call the correct controller
include 'controller/'.$page.'.php';
// Show the footer
include 'template/footer.php';
?>
include 'template/footer.php';
\ No newline at end of file
......@@ -3,6 +3,11 @@
<div class="page-header">
<h1>Sticky footer with fixed navbar</h1>
</div>
<pre>
<?php print_r($url); ?>
<pre>
<?php print_r($_SERVER); ?>
</pre>
<p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added with <code>padding-top: 60px;</code> on the <code>body > .container</code>.</p>
<p>Back to <a href="../sticky-footer">the default sticky footer</a> minus the navbar.</p>
</div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment