Skip to content

Instantly share code, notes, and snippets.

@alganet
Created April 11, 2011 04:10
Show Gist options
  • Save alganet/913047 to your computer and use it in GitHub Desktop.
Save alganet/913047 to your computer and use it in GitHub Desktop.
Toying with microframework concepts
<?php
//users
Web::serve('/users', function() {
return 'Hello World';
});
//users/alganet
Web::serve('/users/*', function($screenName) {
return "Hello $screenName";
});
//posts/2010/10/10/comments
Web::serve('/posts/*/*/*/comments', function($year, $month, $day) {
});
//users/alganet/lists/php
Web::serve('/users/*/lists/*', function($screenName, $listName) {
});
//users/alganet
$view = Twig_BlaBlaBla();
Web::serve('/users/*', function($screenName) use ($view) {
return $view
->loadTemplate("user.phtml")
->display(array("screen_name"=>$screenName));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment