forked from dvmnz/Simple-MVC-without-a-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
26 lines (20 loc) · 652 Bytes
/
index.php
File metadata and controls
26 lines (20 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
//our entry into the web application
//all the requests will pass through this file
//we load the db connection config file
require_once("db.php");
//we read the product intent into two variables
//$controller and $action passed over query string
if(isset($_GET["controller"])&&isset($_GET["action"])){
$controller=$_GET["controller"];
$action=$_GET["action"];
}
else
{
//in case the product doesnt give us this values, we set them to a default controller and action
$controller="product";
$action="all";
}
//we load up our routing code, that will execute the action on the controller
require_once("routes.php");
?>