예제 #1
0
 public function get_route($route_name)
 {
     if (isset($this->routes[$route_name])) {
         return $this->routes[$route_name];
     }
     switch ($route_name) {
         case 'AdminIndex':
             return $this->routes[$route_name] = Route::factory(array('name' => $route_name, 'methods' => array('GET'), 'query' => 'admin', 'handler' => array($this, 'handle_admin'), 'response_wrapper' => '\\Sedra\\Response\\HTTP\\AdminPage'));
         default:
             throw new NoSuchRouteException($route_name);
     }
 }
예제 #2
0
 public function get_route($route_name)
 {
     if (isset($this->routes[$route_name])) {
         return $this->routes[$route_name];
     }
     switch ($route_name) {
         case 'BlogIndex':
             return $this->routes[$route_name] = Route::factory(array('name' => $route_name, 'methods' => array('GET'), 'query' => 'blog', 'handler' => array($this, 'handle_index'), 'response_wrapper' => '\\Sedra\\Response\\HTTP\\Page'));
         case 'BlogArticle':
             return $this->routes[$route_name] = Route::factory(array('name' => $route_name, 'methods' => array('GET'), 'query' => 'blog/article/:id', 'filters' => array('id' => '[0-9]+'), 'handler' => array($this, 'handle_article'), 'response_wrapper' => '\\Sedra\\Response\\HTTP\\Page'));
         default:
             throw new NoSuchRouteException($route_name);
     }
 }