From 53a63959b755ca41d9b1532f8144c3d3c59c8815 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sat, 27 Dec 2014 23:55:30 +0200 Subject: [PATCH] fixes --- ipf/middleware/error.php | 2 +- ipf/router.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ipf/middleware/error.php b/ipf/middleware/error.php index b69dca5..69ba101 100644 --- a/ipf/middleware/error.php +++ b/ipf/middleware/error.php @@ -11,7 +11,7 @@ class IPF_Error_Middleware extends IPF_Middleware } if (!($response instanceof IPF_HTTP_Response)) { - throw new \Exception('Response in not a IPF_HTTP_Response'); + throw new \Exception('Response is not a IPF_HTTP_Response'); } return $response; diff --git a/ipf/router.php b/ipf/router.php index 5e1347c..22d5854 100644 --- a/ipf/router.php +++ b/ipf/router.php @@ -16,8 +16,8 @@ class IPF_Router if (isset($route['urls'])) { $nested = \PFF\Arr::pop($route, 'urls'); - $prefix .= \PFF\Arr::pop($route, 'prefix', ''); - $this->flattenRoutes($nested, $prefix, $route); + $p = $prefix . \PFF\Arr::pop($route, 'prefix', ''); + $this->flattenRoutes($nested, $p, $route); } elseif (isset($route['regex'])) { $this->routes[] = new IPF_Route($prefix . $route['regex'], 'IPF_Router_RegexMatch', $route); } elseif (isset($route['expr'])) { @@ -45,14 +45,14 @@ class IPF_Router foreach ($this->routes as $route) { $result[] = array( $route->expr, - $route->func, + $route->controller() . '#' . $route->action(), ); } return $result; } public function reverse($view, $params=array()) - { + { foreach ($this->routes as $route) if ($route->routesTo($view)) return IPF::get('app_base') . $route->matcher()->reverse($params); -- 2.49.0