Created
September 17, 2012 15:27
-
-
Save KamilaBorowska/3737998 to your computer and use it in GitHub Desktop.
Best PHP framework which makes PHP sort of... useless... I guess?
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 | |
require 'off-rails.php'; | |
get('/', 'index'); | |
function index() { | |
echo 'Hello, world!'; | |
} | |
get('/old-main', 'redir_to_main'); | |
function redir_to_main() { | |
redirect('/'); | |
} | |
whatever('/*', 'error404'); | |
function error404($page) { | |
give(404); | |
echo "I'm sorry, but $page doesn't exist (also XSS!)."; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment