Php model to define routes with a wide range of possibilities, like routing of laravel, but without relying on anyone, you can adapt this model to your model view controller system very easily.
6
3
1
Package Data
Maintainer Username: hispanicode
Maintainer Contact: manudavgonz@gmail.com (ManuDavila)
Package Create Date: 2016-07-02
Package Last Update: 2016-07-02
Home Page:
Language: PHP
License: GPL3
Last Refreshed: 2021-04-29 03:25:08
Package Statistics
Total Downloads: 6
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 3
Total Watchers: 1
Total Forks: 0
Total Open Issues: 1

use Hispanic\Route;

class TestController{

public function home()
{
	include "Views/home/home.php";
}

public function get()
{
	return "The value is: " . $_GET["name"];
}

public function login()
{
	//Example if you like show a view, create your custom model view, the include is not the best solution
	include "Views/home/login.php";
}

public function check_login()
{
	if (isset($_POST["name"]) && isset($_POST["password"])) {
		if ($_POST["name"] == "demo" && $_POST["password"] == "demo") {
			$_SESSION["auth"] = true;
			$_SESSION["user_name"] = $_POST["name"];
			header("location: " . Route::url("home/dashboard"));
			exit;
		}
	}
	header("location:" . Route::url("home/login"));
	exit;
}

public function dashboard()
{
	return "Welcome " . $_SESSION["user_name"];
}

public function arguments()
{
	return "Arg1 = " . $_GET["arg1"] . "| Arg2 = " . urldecode($_GET["arg2"]);
}

public function optional_argument()
{
	return "Arg = " . $_GET["arg"];
}

}