'comission', DP . '/auction' => 'auction', DP . '/debuger' => 'debuger', DP . '/admin' => 'admin' ); $found_module = false; foreach ( $urls as $url => $handler ) { if ( preg_match("#^" . $url . "/*$#", $uri) ) { $class_name = "Logic\\$handler"; if(class_exists($class_name)) { $controller = new $class_name; $controller->defaultAction(); $found_module = true; }else{ self::ErrorClass404($class_name); } break; } else { continue; } } if ( !$found_module ) { self::ErrorPage404(); } } public static function redirect($url) { header('Location: ' . $url); } public static function ErrorPage404() { die('Страница не найдена'); } public static function ErrorClass404($name) { die('Расширение '. $name .' не найдено'); } } ?>