Sindbad~EG File Manager
<?php
namespace O2switch\CpanelLib\Framework;
use Symfony\Component\HttpFoundation\Request;
class Router
{
/**
* @var array
*/
private $routes;
public function __construct(array $routes){
$this->routes = $routes;
}
/**
* @return array
*/
public function match(Request $request){
if($request->query->has('r')){
return isset($this->routes[$request->query->get('r')])
? $this->routes[$request->query->get('r')]
: $this->http404();
}
return $this->routes['index'];
}
public function http404(){
return $this->routes[404];
}
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists