Created
May 28, 2012 05:45
-
-
Save pateketrueke/2817493 to your computer and use it in GitHub Desktop.
Example loading through the Composer to run tetl:::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
<?php | |
require 'vendor/tetlphp/framework/initialize.php'; | |
import('www'); | |
run(function () { | |
root(function () { | |
echo 'Hello ', link_to('World', url_for::some_action()); | |
}); | |
get('/some(/*what)', function () { | |
$links[] = url_for(ROOT); | |
$links[] = url_for::some('luck'); | |
$links[] = url_for::some('WTF'); | |
$links[] = url_for::some_hell_yeah('#!/!!!asdfgjh'); | |
$links[] = url_for('some/thing/to/say'); | |
$links[] = url_for('it\'s a trap!'); | |
$pick = function ($arr) { | |
shuffle($arr); | |
return array_pop($arr); | |
}; | |
$link = $pick($links); | |
echo 'That "', strtr(params('what'), '/', ' '), '" ', link_to('back', $link), '!'; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment