Exemplo n.º 1
0
 public function testBeforeAndAfterFilterOrder()
 {
     $stack = array();
     $this->app->before(function () use(&$stack) {
         $stack[] = 'before';
     });
     $this->app->after(function () use(&$stack) {
         $stack[] = 'after';
     });
     Router::get('/', function () use(&$stack) {
         $stack[] = 'route';
         return 'Hello';
     });
     $this->app->run();
     $this->assertEquals(array('before', 'route', 'after'), $stack);
 }
Exemplo n.º 2
0
 public function register()
 {
     $route = Router::get($this->mountPath . '/{asset}', function ($asset) {
         return $this->render($asset);
     });
     $route->where('asset', '.+\\..+');
     return $this;
 }