/** * @static * @param array $config * <code> * array( * array('<controler:(foo|bar)>', '<controller>/index'), * ... * ) * </code> * @return Router */ public static function fromArray(array $config) { $router = new self(); foreach ($config as $routeParams) { $router->addRouteRule(new RouteRule($routeParams[1], $routeParams[0])); } return $router; }