Created
June 26, 2013 23:10
-
-
Save jackmakiyama/5872583 to your computer and use it in GitHub Desktop.
Respect exceptionRoute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Respect\Rest\Router; | |
require_once 'vendor/autoload.php'; | |
// Routes | |
$router = new Router('/public'); | |
$router->any('/', 'Teste ok'); | |
$router->any('/**', function(){ | |
throw new RuntimeException(); | |
}); | |
$router->exceptionRoute('RuntimeException', function($e) { | |
return 'Caught a Gotcha!'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment