소스 검색

fixed Router UrlAction

Piotr Labudda 8 년 전
부모
커밋
08063c6376
1개의 변경된 파일9개의 추가작업 그리고 6개의 파일을 삭제
  1. 9 6
      SE/se-lib/Router.php

+ 9 - 6
SE/se-lib/Router.php

@@ -43,15 +43,18 @@ class Router {
 		if ('UrlAction' === substr($route, 0, strlen('UrlAction'))) { // Use project/{$activeProject}/tools/{$routeName}.php
 			$routeClassName = substr($route, strlen('UrlAction') + 1);
 			$activeProjectPath = Config::getProjectPath();
-			$toolPath = "{$activeProjectPath}/tools/{$routeClassName}.php";
-			if (file_exists($toolPath)) {
-				require_once $toolPath;
-				if (!class_exists($routeClassName)) throw new HttpException("Not found class", 404);
-				$_routeInstances[$route] = new $routeClassName();
-				return $_routeInstances[$route];
+			if ($activeProjectPath) {
+				$toolPath = "{$activeProjectPath}/tools/{$routeClassName}.php";
+				if (file_exists($toolPath)) {
+					require_once $toolPath;
+					if (!class_exists($routeClassName)) throw new HttpException("Not found class", 404);
+					$_routeInstances[$route] = new $routeClassName();
+					return $_routeInstances[$route];
+				}
 			}
 		}
 
+		$routeClassName = "Route_{$route}";
 		if (Lib::tryLoadClass($routeClassName)) {
 			$_routeInstances[$route] = new $routeClassName();
 			return $_routeInstances[$route];