private static function rewritePath($options) { foreach (self::$reservedOptions as $opt) { unset($options[$opt]); } if (isset($options['params'])) { foreach ($options['params'] as $key => $value) { $options[$key] = $value; } unset($options['params']); } list($path, $extraKeys) = SRoutes::generate($options); if (!empty($extraKeys)) { $path .= self::buildQueryString($extraKeys); } return $path; }
public function dispatch() { try { $map = (include ROOT_DIR . '/conf/routes.php'); SRoutes::initialize($map); SLocale::initialize(); $request = new SRequest(); $response = new SResponse(); if (file_exists($path = APP_DIR . '/controllers/application_controller.php')) { require_once $path; } if (file_exists($path = APP_DIR . '/helpers/application_helper.php')) { require_once $path; } SActionController::factory(SRoutes::recognize($request), $response)->out(); } catch (Exception $e) { SActionController::processWithException($request, $response, $e)->out(); } }
public function initialize($map) { self::$map = $map; self::$map->draw(); }