Пример #1
0
 public function route()
 {
     $registry = Registry::getInstance();
     foreach (Redirect::getList(Redirect::ACTIVE) as $redirect) {
         if (preg_match($redirect->source, $this->redirectSourceUrl)) {
             Redirect::updateRequestDate($redirect->id);
             RedirectQuery::register();
             $destination = str_replace('{site_root}', $registry->get('site_root'), $redirect->destination);
             header('Location: ' . $destination, TRUE, $registry->status);
             die;
         }
     }
     foreach (Router::getList() as $router) {
         if (preg_match($router->url, substr($this->originalUrl, 1))) {
             $controllerName = $router->controller . 'Controller';
             $controller = new $controllerName();
             exit;
         }
     }
 }
Пример #2
0
 function renumber()
 {
     Router::renumberAll($_POST['order']);
     echo 'OK';
 }