if(isset($_GET['route'])) {
$uri = explode('/', $_GET['route']);
if(empty($uri[0])) {
$controller = 'index';
$action = 'index';
} else {
if(in_array($allowed_controllers) == $uri[0]) {
$controller = $uri[0];
if(empty($uri[1])) {
$action = 'index';
} else {
if(in_array($allowed_actions) == $uri[1]) {
$action = $uri[1];
} else {
include '/404.php';
exit();
}
}
} else {
include '/404.php';
exit();
}
}
include "/controllers/{$controller}_controller.php";
}
Как можно сделать красиво и аккуратно?