コード例 #1
0
 public function run()
 {
     try {
         // routing.
         $uriParts = explode('?', $_SERVER['REQUEST_URI'], 2);
         $connect = Lazy_Http_Dispatcher::dispatch($uriParts[0]);
         // create request/response objects.
         $request = $this->createRequest($connect['params']);
         $response = $this->createResponse();
         // call controller.
         require_once 'controllers/' . $connect['controller'] . '.php';
         $controller = new $connect['controller']();
         $controller->{$connect}['action']($request, $response);
     } catch (Exception $e) {
         $this->displayErrorPage($e);
     }
 }
コード例 #2
0
 protected function redirectTo($controller, $action = 'index', $params = array())
 {
     header('Location: ' . Lazy_Http_Dispatcher::urlTo($controller, $action, $params));
     exit;
 }
コード例 #3
0
 public static function setBase($base)
 {
     self::$base = $base;
 }