|
|
@@ -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];
|