I am new to Php mvc design and I have been reading a tutorial, Simple MVC for beginners. In this tutorial the author is routing all calls from the index.php
file based on some link. I have a landing page written in html and was wondering how would i route my, lets say when a user clicks the sign up button, sign up view based on a button not link?
That brings me to another question. Would a controller even be necessary going from a landing page view to a signup view?
views/layout page:
<DOCTYPE html>
<html>
<head>
</head>
<body>
<header>
<a href='/php_mvc_blog'>Home</a>
</header>
<?php require_once('routes.php'); ?>
<footer>
Copyright
</footer>
<body>
<html>
index.php:
<?php
require_once('connection.php');
if (isset($_GET['controller']) && isset($_GET['action'])) {
$controller = $_GET['controller'];
$action = $_GET['action'];
} else {
$controller = 'pages';
$action = 'home';
}
require_once('views/layout.php');
?>