-
Notifications
You must be signed in to change notification settings - Fork 0
Simple routing
JulianFun123 edited this page Jun 22, 2019
·
3 revisions
Routing for example.com/test
$router->set(
[
"/test" => "test.php"
]
);
Routing for example.com/
$router->set(
[
"/" => "homepage.php"
]
);
Routing for example.com/dir/st
$router->set(
[
"/dir/st" => "st.php"
]
);
$router->set(
[
"@__404__@" => "404.php"
]
);
$views_dir = "../views/";
$templates_dir = "../views/templates/";
$route = [
"/" => "homepage.php",
"/about" => "about.php",
"/custom/(.*)" => "customtest.php",
"@__404__@" => "404.php"
];
require "../app/route.php";
require "../devermrouter/Router.php";
$router = new Router($template, $views_dir);
$router->set($route);
$router->route();
Devern Router made by JulianFun123 @ InteraApps.de!