MVC architecture like laravel
===

Recently i started learning Lavarel and is really good PHP framework. Currently i'm trying to make my own MVC similar how Lavarel works. 

**My logic** 
We set the routes, then we check if the current Url exist and from there we will set the controller and the method from `'uses'`, if not we will set the controller to `ERROR`.
The problem is that I can't access the $routes variable.

If i try `static::$routes = ..` the php shows an error, but Lavarel is working ok even though my php version is **5.2** . I don't understand how the whole thing works. Also if u have any suggestions how to structure the architecture :)

**index.php**

    include 'router.php';
    include 'route.php';
    
    
    Route::get('about',array('uses'=> 'about@index'));
    Route::get('about2',array('uses'=> 'about@index'));

**router.php**

    class Router {
    
    	public static $routes = array(
    		'GET'    => array(),
    		'POST'   => array(),
    		'PUT'    => array(),
    		'DELETE' => array(),
    		'PATCH'  => array(),
    		'HEAD'   => array(),
    	);
    
    	public $valid = false;
    
    	public static $methods = array('GET', 'POST', 'PUT', 'DELETE', 'HEAD');
    
    
    	public static function register($method, $route, $action)
    	{		
    
    		if (ctype_digit($route)) $route = "({$route})";
    
    		if (is_string($route)) $route = explode(', ', $route);
    
    		foreach ((array) $route as $uri){
    			if (is_array($action)){
    				$routes[$method][$uri] = $action;
    			}
    		}
    
     		$request = $_SERVER['REQUEST_URI'];
    		$request = trim($request, '/');
    
    		$exist = array_key_exists($request, $routes[$method]);
    
    		if($exist){
    			$valid = true;
    		} 
    
    		echo $valid;
    
    		// print_r($routes);
    	}
    
    }

**route.php**

    class Route {
    
    
    	public static function get($route, $action)
    	{
    		Router::register('GET', $route, $action);
    	}
    
    }