<html>
<head>
<title>PHP and MVC Functionality ... RJM Programming</title>
</head>
<body style="background-color: orange;">
<?php
require_once('model.php');
require_once('view.php');
require_once('controller.php');

$model = new Model();
$controller = new Controller($model);
$view = new View($controller, $model);
 
if (isset($_GET['action']) && !empty($_GET['action'])) {
    if (isset($_GET['to'])) {
      $controller->{$_GET['action']}($_GET['to']);
    } else {
      $controller->{$_GET['action']}();
    }
}
 
echo $view->output();

?>
</body>
</html>
