Created
August 3, 2014 19:10
-
-
Save h0lyalg0rithm/3e22bdd2028a25adb082 to your computer and use it in GitHub Desktop.
Routing example with Toro
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
FallbackResource /index.php |
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
require 'Toro.php' | |
class RootHandler{ | |
function get(){ | |
echo 'Root'; | |
} | |
} | |
Toro::add('404',function(){ | |
header("HTTP/1.0 404 Not Found"); | |
echo "<h1>404 Page Not Found</h1>"; | |
exit; | |
}); | |
Toro::server(array( | |
'/' => 'RootHandler' | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment