Exemplo n.º 1
0
 public function test()
 {
     $request = Request::instance();
     $uri = 'demo/test/{param1?}/{param2?}/{param3?}/{slug?}';
     //
     $route = new Route('GET', $uri, function () {
         echo 'Hello, World!';
     });
     $route->where('slug', '(.*)');
     // Match the Route.
     if ($route->matches($request)) {
         $route->bind($request);
         $content = '<pre>Route matched!</pre>';
     } else {
         $content = '<pre>Route not matched!</pre>';
     }
     $content .= '<pre>' . htmlspecialchars(var_export($route, true)) . '</pre>';
     return View::make('Default')->shares('title', __d('demos', 'Test'))->with('content', $content);
 }