Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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();
     }
 }
Ejemplo n.º 3
0
 public function initialize($map)
 {
     self::$map = $map;
     self::$map->draw();
 }