I have an index.php and in it I want to generate the page template it should show. So when you're on index.php you see the home.php template.
If you're on the index.php?chapter=chapter-name you see the chapter.php template. And if you're on the index.php?marker=marker-name you see the marker.php template.
I now have the following:
<?php
if(!isset($_GET["chapter"])){
$page = "root";
include_once('view/home.php');
} else {
$page = $_GET["chapter"];
switch($page){
case "chapter-name":
include_once('view/chapter.php');
break;
case "marker-name":
include_once('view/marker.php');
break;
}
}
?>
Thanks!