Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 21st, 2012  |  syntax: None  |  size: 0.42 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $app = new Slim();
  3.  
  4. //routes here
  5. $app->get('/', 'home');
  6. $app->get('/hi/:first(/)', 'hi');
  7. $app->get('/test(/)', 'test');
  8. $app->run();
  9.  
  10. //controllers here!
  11. function home(){
  12.         global $config;
  13.         $title = "Hello World";
  14.         require $config->viewsPath . "header.php";
  15.         require $config->viewsPath . "home.php";
  16.         require $config->viewsPath . "footer.php";
  17. }
  18.  
  19. function hi($first){
  20.         echo "hi $first";
  21. }
  22.  
  23. function test(){
  24.         phpinfo();
  25. }
  26. ?>