Example #1
0
 public static function route($route, array $params = array())
 {
     list($controller, $action) = Route::routeToAction($route);
     $controller = substr($controller, 0, strlen($controller) - strlen('Controller'));
     $action = substr($action, 0, strlen($action) - strlen('Action'));
     $path = "/" . str_ireplace('\\', '/', $controller) . '/' . $action;
     $query = http_build_query($params);
     $url = $path . (empty($query) ? '' : '?' . $query);
     return $url;
 }