Guest User

Untitled

a guest
Sep 23rd, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  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. ?>
Add Comment
Please, Sign In to add comment